8 #include "ringbuffer.h" 79 bool g =
false,
bool h =
false,
82 m_language(b), m_language_index(c), m_stream_id(
d),
83 m_easy_reader(f), m_wide_aspect_ratio(g), m_orig_num_channels(e), m_forced(h),
86 bool g =
false,
bool h =
false,
bool i =
false,
88 m_av_stream_index(a), m_av_substream_index(e),
89 m_language(b), m_language_index(c), m_stream_id(
d),
90 m_easy_reader(g), m_wide_aspect_ratio(h), m_orig_num_channels(f), m_forced(i),
94 int m_av_stream_index {-1};
96 int m_av_substream_index {-1};
100 bool m_easy_reader {
false};
101 bool m_wide_aspect_ratio {
false};
102 int m_orig_num_channels {2};
103 bool m_forced {
false};
127 virtual void Reset(
bool reset_video_data,
bool seek_reset,
bool reset_file);
129 virtual int OpenFile(
RingBuffer *rbuffer,
bool novideo,
151 virtual void SetWatchingRecording(
bool mode);
153 virtual bool GetFrame(
DecodeType Type,
bool &Retry) = 0;
159 virtual long long GetChapter(
int ) {
return m_framesPlayed; }
160 virtual bool DoRewind(
long long desiredFrame,
bool discardFrames =
true);
161 virtual bool DoFastForward(
long long desiredFrame,
bool discardFrames =
true);
166 uint64_t absPosition,
168 float fallback_ratio = 1.0);
171 uint64_t relPosition,
173 float fallback_ratio = 1.0);
176 float fallback_ratio);
177 uint64_t TranslatePositionFrameToMs(
long long position,
178 float fallback_framerate,
180 uint64_t TranslatePositionMsToFrame(uint64_t dur_ms,
181 float fallback_framerate,
188 virtual bool IsLastFrameKey(
void)
const = 0;
189 virtual void WriteStoredData(
RingBuffer *rb,
bool storevid,
190 long timecodeOffset) = 0;
197 virtual long UpdateStoredFrameNum(
long frame) = 0;
199 virtual double GetFPS(
void)
const {
return m_fps; }
203 virtual void UpdateFramesPlayed(
void);
208 virtual QString GetCodecDecoderName(
void)
const = 0;
210 virtual MythCodecID GetVideoCodecID(
void)
const = 0;
212 virtual void ResetPosMap(
void);
213 virtual bool SyncPositionMap(
void);
214 virtual bool PosMapFromDb(
void);
215 virtual bool PosMapFromEnc(
void);
217 virtual bool FindPosition(
long long desired_value,
bool search_adjusted,
218 int &lower_bound,
int &upper_bound);
220 uint64_t SavePositionMapDelta(
long long first_frame,
long long last_frame);
221 virtual void SeekReset(
long long newkey,
uint skipFrames,
222 bool doFlush,
bool discardFrames);
230 void SetWaitForChange(
void);
231 bool GetWaitForChange(
void)
const;
232 void SetReadAdjust(
long long adjust);
236 virtual QStringList GetTracks(
uint type)
const;
238 {
return m_tracks[
type].size(); }
240 virtual int GetTrackLanguageIndex(
uint type,
uint trackNo)
const;
241 virtual QString GetTrackDesc(
uint type,
uint trackNo)
const;
242 virtual int SetTrack(
uint type,
int trackNo);
245 inline int IncrementTrack(
uint type);
246 inline int DecrementTrack(
uint type);
247 inline int ChangeTrack(
uint type,
int dir);
253 virtual QString
GetXDS(
const QString&)
const {
return QString(); }
262 void SaveTotalDuration(
void);
264 void SaveTotalFrames(
void);
269 AVPixelFormat GetBestVideoFormat(AVPixelFormat* Formats);
272 virtual int AutoSelectTrack(
uint type);
273 inline void AutoSelectTracks(
void);
274 inline void ResetTracks(
void);
276 void FileChanged(
void);
278 virtual bool DoRewindSeek(
long long desiredFrame);
279 virtual void DoFastForwardSeek(
long long desiredFrame,
bool &needflush);
281 long long ConditionallyUpdatePosMap(
long long desiredFrame);
282 long long GetLastFrameInPosMap(
void)
const;
283 unsigned long GetPositionMapSize(
void)
const;
298 int m_current_width {640};
299 int m_current_height {480};
300 float m_current_aspect {1.33333f};
301 double m_fps {29.97};
302 int m_fpsMultiplier {1};
306 long long m_framesPlayed {0};
307 long long m_framesRead {0};
308 unsigned long long m_frameCounter {0};
310 long long m_lastKey {0};
311 int m_keyframedist {-1};
312 long long m_indexOffset {0};
318 bool m_trackTotalDuration {
false};
321 bool m_exitafterdecoded {
false};
322 bool m_transcoding {
false};
324 bool m_hasFullPositionMap {
false};
325 bool m_recordingHasPositionMap {
false};
326 bool m_posmapStarted {
false};
329 mutable QMutex m_positionMapLock {QMutex::Recursive};
333 bool m_dontSyncPositionMap {
false};
336 uint64_t m_seeksnap {UINT64_MAX};
337 bool m_livetv {
false};
338 bool m_watchingrecording {
false};
340 bool m_hasKeyFrameAdjustTable {
false};
342 bool m_getrawframes {
false};
343 bool m_getrawvideo {
false};
345 bool m_errored {
false};
347 bool m_waitingForChange {
false};
348 long long m_readAdjust {0};
349 bool m_justAfterChange {
false};
350 int m_videoRotation {0};
353 bool m_decodeAllSubtitles {
false};
367 int size = m_tracks[
type].size();
369 next_track = (max(-1, m_currentTrack[
type]) + 1) % size;
370 return SetTrack(
type, next_track);
376 int size = m_tracks[
type].size();
378 next_track = (max(+0, m_currentTrack[
type]) + size - 1) % size;
379 return SetTrack(
type, next_track);
385 return IncrementTrack(
type);
387 return DecrementTrack(
type);
399 m_currentTrack[i] = -1;
405 int size = m_tracks[
type].size();
407 next_track = (max(0, m_currentTrack[
type]) + 1) % size;
virtual QByteArray GetSubHeader(uint) const
bool HasPositionMap(void) const
virtual void SetIdrOnlyKeyframes(bool)
QString toString(TrackType type)
virtual void SetEofState(EofState eof)
int GetTrack(uint type) const
void SetLiveTVMode(bool live)
MythCodecContext * GetMythCodecContext(void)
long long GetFramesPlayed(void) const
virtual void ClearStoredData(void)
uint64_t GetSeekSnap(void) const
bool operator<(const StreamInfo &b) const
MythAVCopy Copy AVFrame<->frame, performing the required conversion if any.
virtual bool SetVideoByComponentTag(int)
StreamInfo(int a, int b, uint c, int d, int e, bool f=false, bool g=false, bool h=false, AudioTrackType i=kAudioTypeNormal)
QDateTime m_lastPositionMapUpdate
VideoDisplayProfile * GetVideoDisplayProfile(void)
vector< int > m_languagePreference
language preferences for auto-selection of streams
virtual long long GetChapter(int)
virtual bool SetAudioByComponentTag(int)
int DecrementTrack(uint type)
virtual void ForceSetupAudioStream(void)
virtual void GetAttachmentData(uint, QByteArray &, QByteArray &)
void ResetTotalDuration(void)
virtual void SetEof(bool eof)
virtual void GetChapterTimes(QList< long long > &)
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
virtual QString GetRawEncodingType(void)
Holds information on recordings and videos.
virtual double GetFPS(void) const
uint GetRawBitrate(void) const
Returns the estimated bitrate if the video were played at normal speed.
const int kDecoderProbeBufferSize
frm_pos_map_t m_frameToDurMap
virtual bool GetRawAudioState(void) const
virtual bool GetRawVideoState(void) const
static const uint16_t * d
void SetFramesPlayed(long long newValue)
int ChangeTrack(uint type, int dir)
StreamInfo(int a, int b, uint c, int d, int e, int f, bool g=false, bool h=false, bool i=false, AudioTrackType j=kAudioTypeNormal)
void SetSeekSnap(uint64_t snap)
static float snap(float value, float snapto, float diff)
virtual QString GetXDS(const QString &) const
AVRational m_totalDuration
int to_track_type(const QString &str)
virtual uint GetTrackCount(uint type) const
float GetVideoAspect(void) const
virtual int GetNumChapters(void)
frm_pos_map_t m_durToFrameMap
vector< PosMapEntry > m_positionMap
void AutoSelectTracks(void)
int IncrementTrack(uint type)
virtual void SetDisablePassThrough(bool disable)
Disables AC3/DTS pass through.
virtual void SetRawAudioState(bool state)
void SetDecodeAllSubtitles(bool val)
int GetfpsMultiplier(void)
void SetTranscoding(bool value)
virtual void SetRawVideoState(bool state)
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
Implements a file/stream reader/writer.
virtual int GetCurrentChapter(long long)
vector< StreamInfo > sinfo_vec_t
void TrackTotalDuration(bool track)
long long GetFramesRead(void) const
VideoDisplayProfile m_videoDisplayProfile
virtual int GetTeletextDecoderType(void) const
virtual int64_t NormalizeVideoTimecode(int64_t timecode)
AVRational AVRationalInit(int num, int den=1)