MythTV  master
Macros | Functions | Variables
avformatdecoder.cpp File Reference
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <iostream>
#include <unistd.h>
#include <QTextCodec>
#include <QFileInfo>
#include "mythtvexp.h"
#include "mythconfig.h"
#include "avformatdecoder.h"
#include "privatedecoder.h"
#include "audiooutput.h"
#include "audiooutpututil.h"
#include "ringbuffer.h"
#include "mythplayer.h"
#include "remoteencoder.h"
#include "programinfo.h"
#include "mythcorecontext.h"
#include "mythdbcon.h"
#include "iso639.h"
#include "mpegtables.h"
#include "atscdescriptors.h"
#include "dvbdescriptors.h"
#include "cc608decoder.h"
#include "cc708decoder.h"
#include "teletextdecoder.h"
#include "subtitlereader.h"
#include "interactivetv.h"
#include "videodisplayprofile.h"
#include "mythuihelper.h"
#include "DVD/dvdringbuffer.h"
#include "Bluray/bdringbuffer.h"
#include "mythavutil.h"
#include "lcddevice.h"
#include "mythcodeccontext.h"
#include "videoout_vdpau.h"
#include "libavcodec/vdpau.h"
#include "videoout_d3d.h"
#include "vaapicontext.h"
#include "libavutil/avutil.h"
#include "libavutil/error.h"
#include "libavutil/log.h"
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavformat/avio.h"
#include "libavformat/internal.h"
#include "libswscale/swscale.h"
#include "libavformat/isom.h"
#include "ivtv_myth.h"
#include "libavutil/imgutils.h"
Include dependency graph for avformatdecoder.cpp:

Go to the source code of this file.

Macros

#define LOC   QString("AFD: ")
 
#define SEQ_PKT_ERR_MAX   10
 
#define FAIL(errmsg)
 
#define SEQ_START   0x000001b3
 
#define GOP_START   0x000001b8
 
#define PICTURE_START   0x00000100
 
#define SLICE_MIN   0x00000101
 
#define SLICE_MAX   0x000001af
 
#define SEQ_END_CODE   0x000001b7
 
#define PACKET_MAX_RETRIES   5000
 
#define RETRY_WAIT_TIME   10000
 

Functions

static int cc608_parity (uint8_t byte)
 
static int cc608_good_parity (const int *parity_table, uint16_t data)
 
static void cc608_build_parity_table (int *parity_table)
 
static QSize get_video_dim (const AVCodecContext &ctx)
 
static float get_aspect (const AVCodecContext &ctx)
 
static float get_aspect (H264Parser &p)
 
int get_avf_buffer (struct AVCodecContext *c, AVFrame *pic, int flags)
 
void release_avf_buffer (void *opaque, uint8_t *data)
 
int get_avf_buffer_vdpau (struct AVCodecContext *c, AVFrame *pic, int flags)
 
void release_avf_buffer_vdpau (void *opaque, uint8_t *data)
 
int render_wrapper_vdpau (struct AVCodecContext *s, AVFrame *src, const VdpPictureInfo *info, uint32_t count, const VdpBitstreamBuffer *buffers)
 
int get_avf_buffer_dxva2 (struct AVCodecContext *c, AVFrame *pic, int flags)
 
int get_avf_buffer_vaapi (struct AVCodecContext *c, AVFrame *pic, int flags)
 
static int determinable_frame_size (struct AVCodecContext *avctx)
 
static int has_codec_parameters (AVStream *st)
 
static bool force_sw_decode (AVCodecContext *avctx)
 
static void myth_av_log (void *ptr, int level, const char *fmt, va_list vl)
 
static int get_canonical_lang (const char *lang_cstr)
 
static int64_t lsb3full (int64_t lsb, int64_t base_ts, int lsb_bits)
 
void HandleStreamChange (void *data)
 
static enum AVPixelFormat get_format_vdpau (struct AVCodecContext *avctx, const enum AVPixelFormat *valid_fmts)
 
static enum AVPixelFormat get_format_dxva2 (struct AVCodecContext *, const enum AVPixelFormat *)
 
static enum AVPixelFormat get_format_vaapi (struct AVCodecContext *, const enum AVPixelFormat *)
 
static bool IS_DR1_PIX_FMT (const enum AVPixelFormat fmt)
 
static vector< int > filter_lang (const sinfo_vec_t &tracks, int lang_key, const vector< int > &ftype)
 
static vector< int > filter_type (const sinfo_vec_t &tracks, AudioTrackType type)
 
static void extract_mono_channel (uint channel, AudioInfo *audioInfo, char *buffer, int bufsize)
 

Variables

static const int max_video_queue_size = 220
 
static bool silence_ffmpeg_logging = false
 

Macro Definition Documentation

◆ LOC

#define LOC   QString("AFD: ")

Definition at line 108 of file avformatdecoder.cpp.

◆ SEQ_PKT_ERR_MAX

#define SEQ_PKT_ERR_MAX   10

Definition at line 112 of file avformatdecoder.cpp.

◆ FAIL

#define FAIL (   errmsg)
Value:
do { \
LOG(VB_PLAYBACK, LOG_DEBUG, LOC + (errmsg)); \
return 0; \
} while (false)
#define LOC

◆ SEQ_START

#define SEQ_START   0x000001b3

Definition at line 3470 of file avformatdecoder.cpp.

◆ GOP_START

#define GOP_START   0x000001b8

Definition at line 3471 of file avformatdecoder.cpp.

◆ PICTURE_START

#define PICTURE_START   0x00000100

Definition at line 3472 of file avformatdecoder.cpp.

◆ SLICE_MIN

#define SLICE_MIN   0x00000101

Definition at line 3473 of file avformatdecoder.cpp.

◆ SLICE_MAX

#define SLICE_MAX   0x000001af

Definition at line 3474 of file avformatdecoder.cpp.

◆ SEQ_END_CODE

#define SEQ_END_CODE   0x000001b7

Definition at line 3475 of file avformatdecoder.cpp.

◆ PACKET_MAX_RETRIES

#define PACKET_MAX_RETRIES   5000

Definition at line 3728 of file avformatdecoder.cpp.

◆ RETRY_WAIT_TIME

#define RETRY_WAIT_TIME   10000

Definition at line 3729 of file avformatdecoder.cpp.

Function Documentation

◆ cc608_parity()

static int cc608_parity ( uint8_t  byte)
static

Definition at line 1827 of file avformatdecoder.cpp.

Referenced by cc608_build_parity_table().

◆ cc608_good_parity()

static int cc608_good_parity ( const int *  parity_table,
uint16_t  data 
)
static

◆ cc608_build_parity_table()

static void cc608_build_parity_table ( int *  parity_table)
static

Definition at line 1843 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::AvFormatDecoder().

◆ get_video_dim()

static QSize get_video_dim ( const AVCodecContext &  ctx)
static

◆ get_aspect() [1/2]

static float get_aspect ( const AVCodecContext &  ctx)
static

◆ get_aspect() [2/2]

static float get_aspect ( H264Parser p)
static

Definition at line 147 of file avformatdecoder.cpp.

◆ get_avf_buffer()

int get_avf_buffer ( struct AVCodecContext *  c,
AVFrame pic,
int  flags 
)

Definition at line 3004 of file avformatdecoder.cpp.

◆ release_avf_buffer()

void release_avf_buffer ( void *  opaque,
uint8_t *  data 
)

◆ get_avf_buffer_vdpau()

int get_avf_buffer_vdpau ( struct AVCodecContext *  c,
AVFrame pic,
int  flags 
)

Definition at line 3053 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::InitVideoCodec().

◆ release_avf_buffer_vdpau()

void release_avf_buffer_vdpau ( void *  opaque,
uint8_t *  data 
)

Definition at line 3079 of file avformatdecoder.cpp.

Referenced by get_avf_buffer_vdpau().

◆ render_wrapper_vdpau()

int render_wrapper_vdpau ( struct AVCodecContext *  s,
AVFrame src,
const VdpPictureInfo *  info,
uint32_t  count,
const VdpBitstreamBuffer *  buffers 
)

Definition at line 3091 of file avformatdecoder.cpp.

Referenced by get_format_vdpau().

◆ get_avf_buffer_dxva2()

int get_avf_buffer_dxva2 ( struct AVCodecContext *  c,
AVFrame pic,
int  flags 
)

Definition at line 3126 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::InitVideoCodec().

◆ get_avf_buffer_vaapi()

int get_avf_buffer_vaapi ( struct AVCodecContext *  c,
AVFrame pic,
int  flags 
)

Definition at line 3152 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::InitVideoCodec().

◆ determinable_frame_size()

static int determinable_frame_size ( struct AVCodecContext *  avctx)
static

Definition at line 200 of file avformatdecoder.cpp.

Referenced by has_codec_parameters().

◆ has_codec_parameters()

static int has_codec_parameters ( AVStream *  st)
static

Definition at line 211 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::OpenFile().

◆ force_sw_decode()

static bool force_sw_decode ( AVCodecContext *  avctx)
static

Definition at line 265 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::ScanStreams().

◆ myth_av_log()

static void myth_av_log ( void *  ptr,
int  level,
const char *  fmt,
va_list  vl 
)
static

Definition at line 290 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::AvFormatDecoder().

◆ get_canonical_lang()

static int get_canonical_lang ( const char *  lang_cstr)
static

◆ lsb3full()

static int64_t lsb3full ( int64_t  lsb,
int64_t  base_ts,
int  lsb_bits 
)
static

◆ HandleStreamChange()

void HandleStreamChange ( void *  data)

Definition at line 986 of file avformatdecoder.cpp.

◆ get_format_vdpau()

static enum AVPixelFormat get_format_vdpau ( struct AVCodecContext *  avctx,
const enum AVPixelFormat *  valid_fmts 
)
static

Definition at line 1441 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::InitVideoCodec().

◆ get_format_dxva2()

enum AVPixelFormat get_format_dxva2 ( struct AVCodecContext *  avctx,
const enum AVPixelFormat *  valid_fmts 
)
static

Definition at line 1481 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::InitVideoCodec().

◆ get_format_vaapi()

enum AVPixelFormat get_format_vaapi ( struct AVCodecContext *  avctx,
const enum AVPixelFormat *  valid_fmts 
)
static

Definition at line 1517 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::InitVideoCodec().

◆ IS_DR1_PIX_FMT()

static bool IS_DR1_PIX_FMT ( const enum AVPixelFormat  fmt)
static

Definition at line 1591 of file avformatdecoder.cpp.

Referenced by get_avf_buffer().

◆ filter_lang()

static vector<int> filter_lang ( const sinfo_vec_t tracks,
int  lang_key,
const vector< int > &  ftype 
)
static

Definition at line 4629 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::AutoSelectAudioTrack().

◆ filter_type()

static vector<int> filter_type ( const sinfo_vec_t tracks,
AudioTrackType  type 
)
static

Definition at line 4644 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::AutoSelectAudioTrack().

◆ extract_mono_channel()

static void extract_mono_channel ( uint  channel,
AudioInfo audioInfo,
char *  buffer,
int  bufsize 
)
static

Definition at line 4949 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::ProcessAudioPacket().

Variable Documentation

◆ max_video_queue_size

const int max_video_queue_size = 220
static

Definition at line 114 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::GetFrame().

◆ silence_ffmpeg_logging

bool silence_ffmpeg_logging = false
static

Definition at line 120 of file avformatdecoder.cpp.

Referenced by AvFormatDecoder::FindStreamInfo(), and myth_av_log().