c++ - IMediaSample Time and MediaTime -


what primary difference between settime , setmediatime?

right in directshow livesource calculate time this

reference_time rtstart = m_rtlastsampletime; m_rtlastsampletime += pvih->avgtimeperframe; pms->settime(&rtstart, &m_rtlastsampletime); pms->setsyncpoint(true); pms->setdiscontinuity(rtstart <= 1); 

this doesn't work encoders.
i've noticed source work these encoders set mediatime , seem jump up.

media times:

optionally, filter can specify media time sample. in video stream, media time represents frame number. in audio stream, media time represents sample number in packet. example, if each packet contains 1 second of 44.1 kilohertz (khz) audio, first packet has media start time of 0 , media stop time of 44100. in seekable stream, media time relative start time of stream. example, suppose seek 2 seconds start of 15-fps video stream. first media sample after seek has time stamp of 0 media time of 30.

renderer , mux filters can use media time determine whether frames or samples have been dropped, checking gaps. however, filters not required set media time. set media time on sample, call imediasample::setmediatime method.

i don't think used anywhere. settime, on contrary, important.


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -