资源简介
ffplay在windows下的移植,使用的SDL库,可以播放H264和mp3-
代码片段和文件信息
#include “stdafx.h“
#include
#include
#ifdef __cplusplus
extern “C“ {
#endif
#include “common.h“
#include “avformat.h“
#include “swscale.h“
#ifdef __cplusplus
}
#endif
#include
#include
#undef exit
static const char program_name[] = “FFplay“;
static const int program_birth_year = 2003;
//#define DEBUG_SYNC
#define MAX_VIDEOQ_SIZE (5 * 256 * 1024)
#define MAX_AUDIOQ_SIZE (5 * 16 * 1024)
/* SDL audio buffer size in samples. Should be small to have precise
A/V sync as SDL does not have hardware buffer fullness info. */
#define SDL_AUDIO_BUFFER_SIZE 1024
/* no AV sync correction is done if below the AV sync threshold */
#define AV_SYNC_THRESHOLD 0.01
/* no AV correction is done if too big error */
#define AV_NOSYNC_THRESHOLD 10.0
/* maximum audio speed change to get correct sync */
#define SAMPLE_CORRECTION_PERCENT_MAX 10
/* we use about AUDIO_DIFF_AVG_NB A-V differences to make the average */
#define AUDIO_DIFF_AVG_NB 20
/* NOTE: the size must be big enough to compensate the hardware audio buffersize size */
#define SAMPLE_ARRAY_SIZE (2*65536)
static int sws_flags = SWS_BICUBIC;
typedef struct PacketQueue {
AVPacketList *first_pkt *last_pkt;
int nb_packets;
int size;
int abort_request;
SDL_mutex *mutex;
SDL_cond *cond;
} PacketQueue;
#define VIDEO_PICTURE_QUEUE_SIZE 1
typedef struct VideoPicture {
double pts; /// SDL_Overlay *bmp;
int width height; /* source height & width */
int allocated;
} VideoPicture;
enum {
AV_SYNC_AUDIO_MASTER /* default choice */
AV_SYNC_VIDEO_MASTER
AV_SYNC_EXTERNAL_CLOCK /* synchronize to an external clock */
};
typedef struct VideoState {
SDL_Thread *parse_tid;
SDL_Thread *video_tid;
AVInputFormat *iformat;
int no_background;
int abort_request;
int paused;
int last_paused;
int seek_req;
int seek_flags;
int64_t seek_pos;
AVFormatContext *ic;
int dtg_active_format;
int audio_stream;
int av_sync_type;
double external_clock; /* external clock base */
int64_t external_clock_time;
double audio_clock;
double audio_diff_cum; /* used for AV difference average computation */
double audio_diff_avg_coef;
double audio_diff_threshold;
int audio_diff_avg_count;
AVStream *audio_st;
PacketQueue audioq;
int audio_hw_buf_size;
/* samples output by the codec. we reserve more space for avsync
compensation */
DECLARE_ALIGNED(16uint8_taudio_buf[(AVCODEC_MAX_AUDIO_frame_SIZE * 3) / 2]);
unsigned int audio_buf_size; /* in bytes */
int audio_buf_index; /* in bytes */
AVPacket audio_pkt;
uint8_t *audio_pkt_data;
int audio_pkt_size;
double frame_timer;
double frame_last_pts;
double fr
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 13606 2008-01-30 10:18 ffmpeg_win32\pla
文件 376 2008-01-27 17:40 ffmpeg_win32\stdafx.h
文件 15150080 2008-02-26 21:13 ffmpeg_win32\pla
文件 52486 2008-02-25 21:14 ffmpeg_win32\ffplay.cpp
文件 53 2008-01-28 13:43 ffmpeg_win32\ReadMe.txt
文件 876 2008-01-27 15:30 ffmpeg_win32\pla
..A..H. 110080 2008-02-26 21:13 ffmpeg_win32\pla
文件 1413 2008-02-26 21:13 ffmpeg_win32\pla
文件 2302 2008-01-23 11:22 ffmpeg_win32\libavutil\integer.h
文件 754 2008-01-21 20:31 ffmpeg_win32\libavutil\Makefile
文件 3147 2008-01-27 13:17 ffmpeg_win32\libavutil\intfloat_readwrite.c
文件 7171 2008-01-21 19:50 ffmpeg_win32\libavutil\ba
文件 4398 2008-01-20 13:37 ffmpeg_win32\libavutil\mathematics.c
文件 3557 2008-01-20 13:37 ffmpeg_win32\libavutil\log.h
文件 2959 2008-01-20 13:37 ffmpeg_win32\libavutil\fifo.c
文件 1737 2008-01-20 13:37 ffmpeg_win32\libavutil\mathematics.h
文件 5166 2008-01-20 14:13 ffmpeg_win32\libavutil\integer.c
文件 1657 2008-01-26 14:18 ffmpeg_win32\libavutil\crc.h
文件 7224 2008-01-23 10:38 ffmpeg_win32\libavutil\intreadwrite.h
文件 1938 2008-01-20 13:37 ffmpeg_win32\libavutil\log.c
文件 6151 2008-01-20 13:37 ffmpeg_win32\libavutil\avutil.h
文件 10166 2008-01-25 15:21 ffmpeg_win32\libavutil\common.h
文件 1284 2008-01-20 13:37 ffmpeg_win32\libavutil\intfloat_readwrite.h
文件 4060 2008-01-20 13:37 ffmpeg_win32\libavutil\crc.c
文件 3213 2008-01-20 13:37 ffmpeg_win32\libavutil\mem.h
文件 2984 2008-01-27 11:14 ffmpeg_win32\libavutil\rational.c
文件 2066 2008-01-20 13:37 ffmpeg_win32\libavutil\string.c
文件 2993 2008-01-25 15:21 ffmpeg_win32\libavutil\rational.h
文件 1234 2008-01-27 11:09 ffmpeg_win32\libavutil\ba
文件 3067 2008-01-20 13:37 ffmpeg_win32\libavutil\avstring.h
............此处省略97个文件信息
评论
共有 条评论