|
|
@ -99,9 +99,9 @@ typedef struct PacketQueue { |
|
|
|
#define SUBPICTURE_QUEUE_SIZE 4 |
|
|
|
#define SUBPICTURE_QUEUE_SIZE 4 |
|
|
|
|
|
|
|
|
|
|
|
typedef struct VideoPicture { |
|
|
|
typedef struct VideoPicture { |
|
|
|
double pts; ///< presentation time stamp for this picture
|
|
|
|
double pts; // presentation timestamp for this picture
|
|
|
|
double target_clock; ///< av_gettime() time at which this should be displayed ideally
|
|
|
|
double target_clock; // av_gettime() time at which this should be displayed ideally
|
|
|
|
int64_t pos; ///< byte position in file
|
|
|
|
int64_t pos; // byte position in file
|
|
|
|
SDL_Overlay *bmp; |
|
|
|
SDL_Overlay *bmp; |
|
|
|
int width, height; /* source height & width */ |
|
|
|
int width, height; /* source height & width */ |
|
|
|
int allocated; |
|
|
|
int allocated; |
|
|
@ -191,13 +191,13 @@ typedef struct VideoState { |
|
|
|
double frame_timer; |
|
|
|
double frame_timer; |
|
|
|
double frame_last_pts; |
|
|
|
double frame_last_pts; |
|
|
|
double frame_last_delay; |
|
|
|
double frame_last_delay; |
|
|
|
double video_clock; ///< pts of last decoded frame / predicted pts of next decoded frame
|
|
|
|
double video_clock; // pts of last decoded frame / predicted pts of next decoded frame
|
|
|
|
int video_stream; |
|
|
|
int video_stream; |
|
|
|
AVStream *video_st; |
|
|
|
AVStream *video_st; |
|
|
|
PacketQueue videoq; |
|
|
|
PacketQueue videoq; |
|
|
|
double video_current_pts; ///< current displayed pts (different from video_clock if frame fifos are used)
|
|
|
|
double video_current_pts; // current displayed pts (different from video_clock if frame fifos are used)
|
|
|
|
double video_current_pts_drift; ///< video_current_pts - time (av_gettime) at which we updated video_current_pts - used to have running video pts
|
|
|
|
double video_current_pts_drift; // video_current_pts - time (av_gettime) at which we updated video_current_pts - used to have running video pts
|
|
|
|
int64_t video_current_pos; ///< current displayed file pos
|
|
|
|
int64_t video_current_pos; // current displayed file pos
|
|
|
|
VideoPicture pictq[VIDEO_PICTURE_QUEUE_SIZE]; |
|
|
|
VideoPicture pictq[VIDEO_PICTURE_QUEUE_SIZE]; |
|
|
|
int pictq_size, pictq_rindex, pictq_windex; |
|
|
|
int pictq_size, pictq_rindex, pictq_windex; |
|
|
|
SDL_mutex *pictq_mutex; |
|
|
|
SDL_mutex *pictq_mutex; |
|
|
@ -213,8 +213,8 @@ typedef struct VideoState { |
|
|
|
PtsCorrectionContext pts_ctx; |
|
|
|
PtsCorrectionContext pts_ctx; |
|
|
|
|
|
|
|
|
|
|
|
#if CONFIG_AVFILTER |
|
|
|
#if CONFIG_AVFILTER |
|
|
|
AVFilterContext *in_video_filter; ///< the first filter in the video chain
|
|
|
|
AVFilterContext *in_video_filter; // the first filter in the video chain
|
|
|
|
AVFilterContext *out_video_filter; ///< the last filter in the video chain
|
|
|
|
AVFilterContext *out_video_filter; // the last filter in the video chain
|
|
|
|
int use_dr1; |
|
|
|
int use_dr1; |
|
|
|
FrameBuffer *buffer_pool; |
|
|
|
FrameBuffer *buffer_pool; |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -1306,10 +1306,8 @@ static void alloc_picture(void *opaque) |
|
|
|
SDL_UnlockMutex(is->pictq_mutex); |
|
|
|
SDL_UnlockMutex(is->pictq_mutex); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/* The 'pts' parameter is the dts of the packet / pts of the frame and
|
|
|
|
* |
|
|
|
* guessed if not known. */ |
|
|
|
* @param pts the dts of the pkt / pts of the frame and guessed if not known |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t pos) |
|
|
|
static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t pos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
VideoPicture *vp; |
|
|
|
VideoPicture *vp; |
|
|
@ -1427,10 +1425,8 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/* Compute the exact PTS for the picture if it is omitted in the stream.
|
|
|
|
* compute the exact PTS for the picture if it is omitted in the stream |
|
|
|
* The 'pts1' parameter is the dts of the packet / pts of the frame. */ |
|
|
|
* @param pts1 the dts of the pkt / pts of the frame |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
static int output_picture2(VideoState *is, AVFrame *src_frame, double pts1, int64_t pos) |
|
|
|
static int output_picture2(VideoState *is, AVFrame *src_frame, double pts1, int64_t pos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
double frame_delay, pts; |
|
|
|
double frame_delay, pts; |
|
|
|