Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: VIDEO_GET_EVENT + VIDEO_GET_SIZE



Andreas Oberritter wrote:
> 
> I just implemented these ioctls for the AViA chip set. There is no
> "aspect ratio changed" or "resolution changed" interrupt, so I abused a
> "displaying first I-frame" interrupt for video size events, which polls
> the status registers.

It's no abuse, it's the usual way to implement it. The MPEG decoder
just tells you when it has decoded a sequence_header, you then have to check
yourself if the size has changed from the previous sequence_header.

> - Imaging two programs not knowing of each other, one with write access
> to the video device and one with read only access.
> The reader might not know that video has been stopped by the writer,
> maybe because he was just to slow or busy after doing a
> VIDEO_GET_STATUS. Shall VIDEO_GET_SIZE fail on stopped video devices?
> Shall it return 0x0 4:3? (There is no "unknown aspect ratio"
> definition.) Or shall it return the last valid resolution and ratio?

Even after the MPEG decoder has stopped, the video scaler might
still display the last decoded frame, so IMHO VIDEO_GET_SIZE
should return its size.

> - What is the expected result for a reader who does a VIDEO_GET_SIZE
> before any writer has opened the device?

Undefined. I would say size 0x0.

> - Why are there multiple events of the same type in the event queue?
> Wouldn't it be enough to provide only the latest event, because the
> application would usually not want to handle e.g. multiple video size
> changed events if it already missed or ignored some of them?

Good point. I just copied stuff from the frontend implementation. We
might also add more events in the future. Or we could have a common
event mechanism for all DVB devices.

> - Should VIDEO_GET_EVENT report events for values already read by
> VIDEO_GET_SIZE? My guess is yes, because VIDEO_GET_SIZE might have been
> called by a second application while another one, which does a
> VIDEO_GET_EVENT after that, might miss it.

Yes.

> - Shall VIDEO_STOP or close() by a writer generate an event like 0x0 4:3
> for possible readers? Shall VIDEO_GET_EVENT fail on closed or stopped
> devices? Shall it return for blocking readers on close or stop? (Similar
> question as above..)

No to all. You might want to setup a listener for video events in your
software (which then e.g. drives 16:9 format signalling via WSS or
SCART). Other parts of your software can open/close devices, switch
from live TV to HDD playback etc., and you don't need to worry about
your VIDEO_GET_EVENT listener.

> I am quite tired now, but I hope it is possible to understand my
> questions (which confused myself even more than before writing them
> down). :-)

We need to defined the semantics and interaction of the ioctls
much more thorough for the V4 API. Your questions are quite
useful, because I didn't spent a minute thinking about this
before, I just implemented VIDEO_GET_EVENT/VIDEO_GET_SIZE the
way I needed it at them moment...


Johannes


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index