libeplayer3: sync with tdt git commit fed2a419dc

This commit is contained in:
Stefan Seyfried
2012-10-03 23:51:56 +02:00
parent 4d43213158
commit 173ef3230a
32 changed files with 314 additions and 248 deletions

View File

@@ -121,5 +121,5 @@ ContainerHandler_t ContainerHandler = {
&SrtContainer, &SrtContainer,
&SsaContainer, &SsaContainer,
&ASSContainer, &ASSContainer,
Command, Command
}; };

View File

@@ -392,6 +392,7 @@ static void ASSThread(Context_t *context) {
// subtitel zeitpunkt zu bestimmen und solange zu schlafen. // subtitel zeitpunkt zu bestimmen und solange zu schlafen.
usleep(1000); usleep(1000);
if(ass_renderer && ass_track)
img = ass_render_frame(ass_renderer, ass_track, playPts / 90.0, &change); img = ass_render_frame(ass_renderer, ass_track, playPts / 90.0, &change);
ass_printf(150, "img %p pts %lu %f\n", img, playPts, playPts / 90.0); ass_printf(150, "img %p pts %lu %f\n", img, playPts, playPts / 90.0);
@@ -469,7 +470,7 @@ static void ASSThread(Context_t *context) {
if (ass_track->events) if (ass_track->events)
{ {
/* fixme: check values */ /* fixme: check values */
out.pts = ass_track->events->Start * 90.0; out.pts = ass_track->events->Start * 90.0;
out.duration = ass_track->events->Duration / 1000.0; out.duration = ass_track->events->Duration / 1000.0;
} else } else
@@ -813,6 +814,5 @@ static char *ASS_Capabilities[] = {"ass", NULL };
Container_t ASSContainer = { Container_t ASSContainer = {
"ASS", "ASS",
&Command, &Command,
ASS_Capabilities, ASS_Capabilities
}; };

View File

@@ -171,7 +171,9 @@ static char* Codec2Encoding(enum CodecID id, int* version)
case CODEC_ID_VC1: case CODEC_ID_VC1:
return "V_VC1"; return "V_VC1";
case CODEC_ID_H264: case CODEC_ID_H264:
#if LIBAVCODEC_VERSION_MAJOR < 54
case CODEC_ID_FFH264: case CODEC_ID_FFH264:
#endif
return "V_MPEG4/ISO/AVC"; return "V_MPEG4/ISO/AVC";
case CODEC_ID_AVS: case CODEC_ID_AVS:
return "V_AVS"; return "V_AVS";
@@ -272,16 +274,29 @@ float getDurationFromSSALine(unsigned char* line){
/* search for metatdata in context and stream /* search for metatdata in context and stream
* and map it to our metadata. * and map it to our metadata.
*/ */
#if LIBAVCODEC_VERSION_MAJOR < 54
static char* searchMeta(AVMetadata *metadata, char* ourTag) static char* searchMeta(AVMetadata *metadata, char* ourTag)
#else
static char* searchMeta(AVDictionary * metadata, char* ourTag)
#endif
{ {
#if LIBAVCODEC_VERSION_MAJOR < 54
AVMetadataTag *tag = NULL; AVMetadataTag *tag = NULL;
#else
AVDictionaryEntry *tag = NULL;
#endif
int i = 0; int i = 0;
while (metadata_map[i] != NULL) while (metadata_map[i] != NULL)
{ {
if (strcmp(ourTag, metadata_map[i]) == 0) if (strcmp(ourTag, metadata_map[i]) == 0)
{ {
#if LIBAVCODEC_VERSION_MAJOR < 54
while ((tag = av_metadata_get(metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) while ((tag = av_metadata_get(metadata, "", tag, AV_METADATA_IGNORE_SUFFIX)))
#else
while ((tag = av_dict_get(metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
#endif
{ {
if (strcmp(tag->key, metadata_map[ i + 1 ]) == 0) if (strcmp(tag->key, metadata_map[ i + 1 ]) == 0)
{ {
@@ -421,7 +436,11 @@ if(!context->playback->BackWard && audioMute)
} }
else else
{ {
#if LIBAVCODEC_VERSION_MAJOR < 54
lastSeek = currentReadPosition = url_ftell(avContext->pb); lastSeek = currentReadPosition = url_ftell(avContext->pb);
#else
lastSeek = currentReadPosition = avio_tell(avContext->pb);
#endif
gotlastPts = 1; gotlastPts = 1;
#ifndef use_sec_to_seek #ifndef use_sec_to_seek
@@ -462,7 +481,11 @@ if(!context->playback->BackWard && audioMute)
int index = packet.stream_index; int index = packet.stream_index;
#if LIBAVCODEC_VERSION_MAJOR < 54
currentReadPosition = url_ftell(avContext->pb); currentReadPosition = url_ftell(avContext->pb);
#else
currentReadPosition = avio_tell(avContext->pb);
#endif
if (context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack) < 0) if (context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack) < 0)
ffmpeg_err("error getting video track\n"); ffmpeg_err("error getting video track\n");
@@ -655,7 +678,6 @@ if(!context->playback->BackWard && audioMute)
/* no clue yet */ /* no clue yet */
} }
/* konfetti: I've found cases where the duration from getDurationFromSSALine /* konfetti: I've found cases where the duration from getDurationFromSSALine
* is zero (start end and are really the same in text). I think it make's * is zero (start end and are really the same in text). I think it make's
* no sense to pass those. * no sense to pass those.
@@ -797,10 +819,18 @@ int container_ffmpeg_init(Context_t *context, char * filename)
avcodec_register_all(); avcodec_register_all();
av_register_all(); av_register_all();
#if LIBAVCODEC_VERSION_MAJOR < 54
if ((err = av_open_input_file(&avContext, filename, NULL, 0, NULL)) != 0) { if ((err = av_open_input_file(&avContext, filename, NULL, 0, NULL)) != 0) {
#else
if ((err = avformat_open_input(&avContext, filename, NULL, 0)) != 0) {
#endif
char error[512]; char error[512];
#if LIBAVCODEC_VERSION_MAJOR < 54
ffmpeg_err("av_open_input_file failed %d (%s)\n", err, filename); ffmpeg_err("av_open_input_file failed %d (%s)\n", err, filename);
#else
ffmpeg_err("avformat_open_input failed %d (%s)\n", err, filename);
#endif
av_strerror(err, error, 512); av_strerror(err, error, 512);
ffmpeg_err("Cause: %s\n", error); ffmpeg_err("Cause: %s\n", error);
@@ -814,8 +844,13 @@ int container_ffmpeg_init(Context_t *context, char * filename)
ffmpeg_printf(20, "find_streaminfo\n"); ffmpeg_printf(20, "find_streaminfo\n");
#if LIBAVCODEC_VERSION_MAJOR < 54
if (av_find_stream_info(avContext) < 0) { if (av_find_stream_info(avContext) < 0) {
ffmpeg_err("Error av_find_stream_info\n"); ffmpeg_err("Error av_find_stream_info\n");
#else
if (avformat_find_stream_info(avContext, NULL) < 0) {
ffmpeg_err("Error avformat_find_stream_info\n");
#endif
#ifdef this_is_ok #ifdef this_is_ok
/* crow reports that sometimes this returns an error /* crow reports that sometimes this returns an error
* but the file is played back well. so remove this * but the file is played back well. so remove this
@@ -829,7 +864,11 @@ int container_ffmpeg_init(Context_t *context, char * filename)
ffmpeg_printf(20, "dump format\n"); ffmpeg_printf(20, "dump format\n");
#if LIBAVCODEC_VERSION_MAJOR < 54
dump_format(avContext, 0, filename, 0); dump_format(avContext, 0, filename, 0);
#else
av_dump_format(avContext, 0, filename, 0);
#endif
ffmpeg_printf(1, "number streams %d\n", avContext->nb_streams); ffmpeg_printf(1, "number streams %d\n", avContext->nb_streams);
@@ -961,8 +1000,6 @@ int container_ffmpeg_init(Context_t *context, char * filename)
printf("AVCODEC__INIT__SUCCESS\n"); printf("AVCODEC__INIT__SUCCESS\n");
else else
printf("AVCODEC__INIT__FAILED\n"); printf("AVCODEC__INIT__FAILED\n");
} }
else if(stream->codec->codec_id == CODEC_ID_AAC) { else if(stream->codec->codec_id == CODEC_ID_AAC) {
ffmpeg_printf(10,"Create AAC ExtraData\n"); ffmpeg_printf(10,"Create AAC ExtraData\n");
@@ -1279,7 +1316,11 @@ static int container_ffmpeg_stop(Context_t *context) {
static int container_ffmpeg_seek_bytes(off_t pos) { static int container_ffmpeg_seek_bytes(off_t pos) {
int flag = AVSEEK_FLAG_BYTE; int flag = AVSEEK_FLAG_BYTE;
#if LIBAVCODEC_VERSION_MAJOR < 54
off_t current_pos = url_ftell(avContext->pb); off_t current_pos = url_ftell(avContext->pb);
#else
off_t current_pos = avio_tell(avContext->pb);
#endif
ffmpeg_printf(20, "seeking to position %lld (bytes)\n", pos); ffmpeg_printf(20, "seeking to position %lld (bytes)\n", pos);
@@ -1292,7 +1333,11 @@ static int container_ffmpeg_seek_bytes(off_t pos) {
return cERR_CONTAINER_FFMPEG_ERR; return cERR_CONTAINER_FFMPEG_ERR;
} }
#if LIBAVCODEC_VERSION_MAJOR < 54
ffmpeg_printf(30, "current_pos after seek %lld\n", url_ftell(avContext->pb)); ffmpeg_printf(30, "current_pos after seek %lld\n", url_ftell(avContext->pb));
#else
ffmpeg_printf(30, "current_pos after seek %lld\n", avio_tell(avContext->pb));
#endif
return cERR_CONTAINER_FFMPEG_NO_ERROR; return cERR_CONTAINER_FFMPEG_NO_ERROR;
} }
@@ -1301,7 +1346,11 @@ static int container_ffmpeg_seek_bytes(off_t pos) {
static int container_ffmpeg_seek_bytes_rel(off_t start, off_t bytes) { static int container_ffmpeg_seek_bytes_rel(off_t start, off_t bytes) {
int flag = AVSEEK_FLAG_BYTE; int flag = AVSEEK_FLAG_BYTE;
off_t newpos; off_t newpos;
#if LIBAVCODEC_VERSION_MAJOR < 54
off_t current_pos = url_ftell(avContext->pb); off_t current_pos = url_ftell(avContext->pb);
#else
off_t current_pos = avio_tell(avContext->pb);
#endif
if (start == -1) if (start == -1)
start = current_pos; start = current_pos;
@@ -1330,7 +1379,11 @@ static int container_ffmpeg_seek_bytes_rel(off_t start, off_t bytes) {
return cERR_CONTAINER_FFMPEG_ERR; return cERR_CONTAINER_FFMPEG_ERR;
} }
#if LIBAVCODEC_VERSION_MAJOR < 54
ffmpeg_printf(30, "current_pos after seek %lld\n", url_ftell(avContext->pb)); ffmpeg_printf(30, "current_pos after seek %lld\n", url_ftell(avContext->pb));
#else
ffmpeg_printf(30, "current_pos after seek %lld\n", avio_tell(avContext->pb));
#endif
return cERR_CONTAINER_FFMPEG_NO_ERROR; return cERR_CONTAINER_FFMPEG_NO_ERROR;
} }
@@ -1359,7 +1412,11 @@ static int container_ffmpeg_seek_rel(Context_t *context, off_t pos, long long in
if (pos == -1) if (pos == -1)
{ {
#if LIBAVCODEC_VERSION_MAJOR < 54
pos = url_ftell(avContext->pb); pos = url_ftell(avContext->pb);
#else
pos = avio_tell(avContext->pb);
#endif
} }
if (pts == -1) if (pts == -1)
@@ -1377,7 +1434,6 @@ static int container_ffmpeg_seek_rel(Context_t *context, off_t pos, long long in
if (avContext->bit_rate) if (avContext->bit_rate)
{ {
sec *= avContext->bit_rate / 8.0; sec *= avContext->bit_rate / 8.0;
ffmpeg_printf(10, "bit_rate %d\n", avContext->bit_rate); ffmpeg_printf(10, "bit_rate %d\n", avContext->bit_rate);
} }
else else
@@ -1465,7 +1521,7 @@ static int container_ffmpeg_seek(Context_t *context, float sec) {
current = audioTrack; current = audioTrack;
if (current == NULL) { if (current == NULL) {
ffmpeg_err( "no track avaibale to seek\n"); ffmpeg_err( "no track available to seek\n");
return cERR_CONTAINER_FFMPEG_ERR; return cERR_CONTAINER_FFMPEG_ERR;
} }
@@ -1485,14 +1541,17 @@ static int container_ffmpeg_seek(Context_t *context, float sec) {
* about 10 seconds, backward does not work. * about 10 seconds, backward does not work.
*/ */
#if LIBAVCODEC_VERSION_MAJOR < 54
off_t pos = url_ftell(avContext->pb); off_t pos = url_ftell(avContext->pb);
#else
off_t pos = avio_tell(avContext->pb);
#endif
ffmpeg_printf(10, "pos %lld %d\n", pos, avContext->bit_rate); ffmpeg_printf(10, "pos %lld %d\n", pos, avContext->bit_rate);
if (avContext->bit_rate) if (avContext->bit_rate)
{ {
sec *= avContext->bit_rate / 8.0; sec *= avContext->bit_rate / 8.0;
ffmpeg_printf(10, "bit_rate %d\n", avContext->bit_rate); ffmpeg_printf(10, "bit_rate %d\n", avContext->bit_rate);
} }
else else
@@ -1599,7 +1658,7 @@ static int container_ffmpeg_swich_subtitle(Context_t* context, int* arg)
/* konfetti comment: I dont like the mechanism of overwriting /* konfetti comment: I dont like the mechanism of overwriting
* the pointer in infostring. This lead in most cases to * the pointer in infostring. This lead in most cases to
* user errors, like it is in the current version (libeplayer2 <-->e2->servicemp3.cpp). * user errors, like it is in the current version (libeplayer2 <-->e2->servicemp3.cpp)
* From e2 there is passed a tag=strdup here and we overwrite this * From e2 there is passed a tag=strdup here and we overwrite this
* strdupped tag. This lead to dangling pointers which are never freed! * strdupped tag. This lead to dangling pointers which are never freed!
* I do not free the string here because this is the wrong way. The mechanism * I do not free the string here because this is the wrong way. The mechanism
@@ -1731,6 +1790,5 @@ static char *FFMPEG_Capabilities[] = {"avi", "mkv", "mp4", "ts", "mov", "flv", "
Container_t FFMPEGContainer = { Container_t FFMPEGContainer = {
"FFMPEG", "FFMPEG",
&Command, &Command,
FFMPEG_Capabilities, FFMPEG_Capabilities
}; };

View File

@@ -486,5 +486,5 @@ static char *SrtCapabilities[] = { "srt", NULL };
Container_t SrtContainer = { Container_t SrtContainer = {
"SRT", "SRT",
&Command, &Command,
SrtCapabilities, SrtCapabilities
}; };

View File

@@ -488,5 +488,5 @@ static char *SsaCapabilities[] = { "ssa", NULL };
Container_t SsaContainer = { Container_t SsaContainer = {
"SSA", "SSA",
&Command, &Command,
SsaCapabilities, SsaCapabilities
}; };

View File

@@ -29,7 +29,7 @@ typedef enum {
OUTPUT_SUBTITLE_REGISTER_FUNCTION = 222, OUTPUT_SUBTITLE_REGISTER_FUNCTION = 222,
OUTPUT_SUBTITLE_REGISTER_BUFFER = 223, OUTPUT_SUBTITLE_REGISTER_BUFFER = 223,
OUTPUT_GET_SUBTITLE_OUTPUT, OUTPUT_GET_SUBTITLE_OUTPUT,
OUTPUT_SET_SUBTITLE_OUTPUT, OUTPUT_SET_SUBTITLE_OUTPUT
} OutputCmd_t; } OutputCmd_t;
typedef struct typedef struct

View File

@@ -58,7 +58,7 @@ typedef enum {
STREAM_TYPE_H264, /* Deprecated */ STREAM_TYPE_H264, /* Deprecated */
STREAM_TYPE_ASF, /* Needs work so it can be deprecated */ STREAM_TYPE_ASF, /* Needs work so it can be deprecated */
STREAM_TYPE_MP4, /* Deprecated */ STREAM_TYPE_MP4, /* Deprecated */
STREAM_TYPE_RAW, /* Deprecated */ STREAM_TYPE_RAW /* Deprecated */
} stream_type_t; } stream_type_t;
/* /*
@@ -322,4 +322,3 @@ typedef dvb_option_t video_option_t;
#define AUDIO_GET_PLAY_INFO _IOR('o', 78, audio_play_info_t) #define AUDIO_GET_PLAY_INFO _IOR('o', 78, audio_play_info_t)
#endif /* H_DVB_STM_H */ #endif /* H_DVB_STM_H */

View File

@@ -244,6 +244,5 @@ static int Command(void *_context, ManagerCmd_t command, void * argument) {
struct Manager_s AudioManager = { struct Manager_s AudioManager = {
"Audio", "Audio",
&Command, &Command,
NULL, NULL
}; };

View File

@@ -45,7 +45,7 @@ ManagerHandler_t ManagerHandler = {
"ManagerHandler", "ManagerHandler",
&AudioManager, &AudioManager,
&VideoManager, &VideoManager,
&SubtitleManager, &SubtitleManager
}; };
/* ***************************** */ /* ***************************** */
@@ -90,4 +90,3 @@ void freeTrack(Track_t* track)
free(track->aacbuf); free(track->aacbuf);
} }

View File

@@ -248,6 +248,5 @@ static int Command(void *_context, ManagerCmd_t command, void * argument) {
struct Manager_s SubtitleManager = { struct Manager_s SubtitleManager = {
"Subtitle", "Subtitle",
&Command, &Command,
NULL, NULL
}; };

View File

@@ -237,6 +237,5 @@ static int Command(void *_context, ManagerCmd_t command, void * argument) {
struct Manager_s VideoManager = { struct Manager_s VideoManager = {
"Video", "Video",
&Command, &Command,
NULL, NULL
}; };

View File

@@ -601,8 +601,8 @@ int LinuxDvbFastForward(Context_t *context, char * type) {
int LinuxDvbReverse(Context_t *context, char * type) { int LinuxDvbReverse(Context_t *context, char * type) {
#ifdef reverse_playback_2
int ret = cERR_LINUXDVB_NO_ERROR; int ret = cERR_LINUXDVB_NO_ERROR;
#ifdef reverse_playback_2
int speed; int speed;
unsigned char video = !strcmp("video", type); unsigned char video = !strcmp("video", type);
@@ -654,8 +654,8 @@ int LinuxDvbReverse(Context_t *context, char * type) {
linuxdvb_printf(10, "exiting with value %d\n", ret); linuxdvb_printf(10, "exiting with value %d\n", ret);
return ret;
#endif #endif
return ret;
} }
int LinuxDvbSlowMotion(Context_t *context, char * type) { int LinuxDvbSlowMotion(Context_t *context, char * type) {
@@ -1204,7 +1204,5 @@ struct Output_s LinuxDvbOutput = {
"LinuxDvb", "LinuxDvb",
&Command, &Command,
&Write, &Write,
LinuxDvbCapabilities, LinuxDvbCapabilities
}; };

View File

@@ -349,5 +349,5 @@ OutputHandler_t OutputHandler = {
NULL, NULL,
NULL, NULL,
NULL, NULL,
&Command, &Command
}; };

View File

@@ -839,7 +839,5 @@ struct Output_s SubtitleOutput = {
"Subtitle", "Subtitle",
&Command, &Command,
&Write, &Write,
SubtitleCapabilitis, SubtitleCapabilitis
}; };

View File

@@ -140,13 +140,12 @@ static WriterCaps_t caps_ac3 = {
"ac3", "ac3",
eAudio, eAudio,
"A_AC3", "A_AC3",
AUDIO_ENCODING_AC3, AUDIO_ENCODING_AC3
}; };
struct Writer_s WriterAudioAC3 = { struct Writer_s WriterAudioAC3 = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&caps_ac3, &caps_ac3
}; };

View File

@@ -177,40 +177,40 @@ static WriterCaps_t mpeg4p2_caps = {
"mscomp", "mscomp",
eVideo, eVideo,
"V_MSCOMP", "V_MSCOMP",
VIDEO_ENCODING_MPEG4P2, VIDEO_ENCODING_MPEG4P2
}; };
struct Writer_s WriterVideoMSCOMP = { struct Writer_s WriterVideoMSCOMP = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&mpeg4p2_caps, &mpeg4p2_caps
}; };
static WriterCaps_t fourcc_caps = { static WriterCaps_t fourcc_caps = {
"fourcc", "fourcc",
eVideo, eVideo,
"V_MS/VFW/FOURCC", "V_MS/VFW/FOURCC",
VIDEO_ENCODING_MPEG4P2, VIDEO_ENCODING_MPEG4P2
}; };
struct Writer_s WriterVideoFOURCC = { struct Writer_s WriterVideoFOURCC = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&fourcc_caps, &fourcc_caps
}; };
static WriterCaps_t divx_caps = { static WriterCaps_t divx_caps = {
"divx", "divx",
eVideo, eVideo,
"V_MKV/XVID", "V_MKV/XVID",
VIDEO_ENCODING_MPEG4P2, VIDEO_ENCODING_MPEG4P2
}; };
struct Writer_s WriterVideoDIVX = { struct Writer_s WriterVideoDIVX = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&divx_caps, &divx_caps
}; };

View File

@@ -158,12 +158,12 @@ static WriterCaps_t caps = {
"dts", "dts",
eAudio, eAudio,
"A_DTS", "A_DTS",
AUDIO_ENCODING_DTS, AUDIO_ENCODING_DTS
}; };
struct Writer_s WriterAudioDTS = { struct Writer_s WriterAudioDTS = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&caps, &caps
}; };

View File

@@ -140,13 +140,12 @@ static WriterCaps_t caps_flac = {
"flac", "flac",
eAudio, eAudio,
"A_FLAC", "A_FLAC",
AUDIO_ENCODING_LPCM, //AUDIO_ENCODING_FLAC, AUDIO_ENCODING_LPCM //AUDIO_ENCODING_FLAC
}; };
struct Writer_s WriterAudioFLAC = { struct Writer_s WriterAudioFLAC = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&caps_flac, &caps_flac
}; };

View File

@@ -186,12 +186,12 @@ static WriterCaps_t caps = {
"framebuffer", "framebuffer",
eGfx, eGfx,
"framebuffer", "framebuffer",
0, 0
}; };
struct Writer_s WriterFramebuffer = { struct Writer_s WriterFramebuffer = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&caps, &caps
}; };

View File

@@ -93,7 +93,6 @@ static int writeData(void* _call)
WriterAVCallData_t* call = (WriterAVCallData_t*) _call; WriterAVCallData_t* call = (WriterAVCallData_t*) _call;
unsigned char PesHeader[PES_MAX_HEADER_SIZE]; unsigned char PesHeader[PES_MAX_HEADER_SIZE];
unsigned char DataCopy[PES_MAX_HEADER_SIZE];
int len = 0; int len = 0;
h263_printf(10, "\n"); h263_printf(10, "\n");
@@ -131,14 +130,21 @@ static int writeData(void* _call)
HeaderLength += PrivateHeaderLength; HeaderLength += PrivateHeaderLength;
unsigned char *PacketData = call->data - HeaderLength; unsigned char *PacketData = malloc(HeaderLength + call->len);
memcpy(DataCopy, PacketData, HeaderLength); if(PacketData != NULL)
{
memcpy(PacketData, PesHeader, HeaderLength); memcpy(PacketData, PesHeader, HeaderLength);
memcpy(PacketData + HeaderLength, call->data, call->len);
len = write(call->fd, PacketData, call->len + HeaderLength); len = write(call->fd, PacketData, call->len + HeaderLength);
memcpy(PacketData, DataCopy, HeaderLength); free(PacketData);
}
else
{
h263_err("no mem\n");
}
h263_printf(10, "< len %d\n", len); h263_printf(10, "< len %d\n", len);
return len; return len;
@@ -152,26 +158,26 @@ static WriterCaps_t caps_h263 = {
"h263", "h263",
eVideo, eVideo,
"V_H263", "V_H263",
VIDEO_ENCODING_H263, VIDEO_ENCODING_H263
}; };
struct Writer_s WriterVideoH263 = { struct Writer_s WriterVideoH263 = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&caps_h263, &caps_h263
}; };
static WriterCaps_t caps_flv = { static WriterCaps_t caps_flv = {
"FLV", "FLV",
eVideo, eVideo,
"V_FLV", "V_FLV",
VIDEO_ENCODING_FLV1, VIDEO_ENCODING_FLV1
}; };
struct Writer_s WriterVideoFLV = { struct Writer_s WriterVideoFLV = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&caps_flv, &caps_flv
}; };

View File

@@ -428,13 +428,12 @@ static WriterCaps_t caps = {
"h264", "h264",
eVideo, eVideo,
"V_MPEG4/ISO/AVC", "V_MPEG4/ISO/AVC",
VIDEO_ENCODING_H264, VIDEO_ENCODING_H264
}; };
struct Writer_s WriterVideoH264 = { struct Writer_s WriterVideoH264 = {
&reset, &reset,
&writeData, &writeData,
&writeReverseData, &writeReverseData,
&caps, &caps
}; };

View File

@@ -123,4 +123,3 @@ void FlushBits(BitPacker_t * ld)
ld->Remaining = 32; ld->Remaining = 32;
ld->BitBuffer = 0; ld->BitBuffer = 0;
} }

View File

@@ -140,26 +140,26 @@ static WriterCaps_t caps_mp3 = {
"mp3", "mp3",
eAudio, eAudio,
"A_MP3", "A_MP3",
AUDIO_ENCODING_MP3, AUDIO_ENCODING_MP3
}; };
struct Writer_s WriterAudioMP3 = { struct Writer_s WriterAudioMP3 = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&caps_mp3, &caps_mp3
}; };
static WriterCaps_t caps_mpegl3 = { static WriterCaps_t caps_mpegl3 = {
"mpeg/l3", "mpeg/l3",
eAudio, eAudio,
"A_MPEG/L3", "A_MPEG/L3",
AUDIO_ENCODING_MPEG2, AUDIO_ENCODING_MPEG2
}; };
struct Writer_s WriterAudioMPEGL3 = { struct Writer_s WriterAudioMPEGL3 = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&caps_mpegl3, &caps_mpegl3
}; };

View File

@@ -154,26 +154,26 @@ static WriterCaps_t caps = {
"mpeg2", "mpeg2",
eVideo, eVideo,
"V_MPEG2", "V_MPEG2",
VIDEO_ENCODING_AUTO, VIDEO_ENCODING_AUTO
}; };
struct Writer_s WriterVideoMPEG2 = { struct Writer_s WriterVideoMPEG2 = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&caps, &caps
}; };
static WriterCaps_t h264_caps = { static WriterCaps_t h264_caps = {
"mpges_h264", "mpges_h264",
eVideo, eVideo,
"V_MPEG2/H264", "V_MPEG2/H264",
VIDEO_ENCODING_H264, VIDEO_ENCODING_H264
}; };
struct Writer_s WriterVideoMPEGH264 = { struct Writer_s WriterVideoMPEGH264 = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&h264_caps, &h264_caps
}; };

View File

@@ -320,27 +320,26 @@ static WriterCaps_t caps_pcm = {
"pcm", "pcm",
eAudio, eAudio,
"A_PCM", "A_PCM",
AUDIO_ENCODING_LPCMA, AUDIO_ENCODING_LPCMA
}; };
struct Writer_s WriterAudioPCM = { struct Writer_s WriterAudioPCM = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&caps_pcm, &caps_pcm
}; };
static WriterCaps_t caps_ipcm = { static WriterCaps_t caps_ipcm = {
"ipcm", "ipcm",
eAudio, eAudio,
"A_IPCM", "A_IPCM",
AUDIO_ENCODING_LPCMA, AUDIO_ENCODING_LPCMA
}; };
struct Writer_s WriterAudioIPCM = { struct Writer_s WriterAudioIPCM = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&caps_ipcm, &caps_ipcm
}; };

View File

@@ -290,4 +290,3 @@ struct Writer_s WriterVideoVC1 = {
NULL, NULL,
&caps &caps
}; };

View File

@@ -140,13 +140,12 @@ static WriterCaps_t caps_vorbis = {
"vorbis", "vorbis",
eAudio, eAudio,
"A_VORBIS", "A_VORBIS",
AUDIO_ENCODING_VORBIS, AUDIO_ENCODING_VORBIS
}; };
struct Writer_s WriterAudioVORBIS = { struct Writer_s WriterAudioVORBIS = {
&reset, &reset,
&writeData, &writeData,
NULL, NULL,
&caps_vorbis, &caps_vorbis
}; };

View File

@@ -278,4 +278,3 @@ struct Writer_s WriterVideoWMV = {
NULL, NULL,
&caps &caps
}; };

View File

@@ -138,4 +138,3 @@ Writer_t* getDefaultFramebufferWriter()
return NULL; return NULL;
} }

View File

@@ -233,7 +233,7 @@ static int PlaybackOpen(Context_t *context, char * uri) {
//free(extension); //free(extension);
} /* http */ } /* http */
else if (!strncmp("mms://", uri, 6) || !strncmp("rtsp://", uri, 7) || !strncmp("rtmp://", uri, 7)) { else if (!strncmp("mms://", uri, 6) || !strncmp("rtsp://", uri, 7) || !strncmp("rtmp://", uri, 7) || !strncmp("rtmpt://", uri, 8) || !strncmp("rtmpe://", uri, 8) || !strncmp("rtmpte://", uri, 9) || !strncmp("rtmps://", uri, 8) || !strncmp("rtp://", uri, 6)) {
/* char * extension = NULL; */ /* char * extension = NULL; */
context->playback->isFile = 0; context->playback->isFile = 0;
context->playback->isHttp = 1; context->playback->isHttp = 1;
@@ -768,7 +768,7 @@ static int PlaybackSeek(Context_t *context, float * pos) {
playback_printf(10, "pos: %f\n", *pos); playback_printf(10, "pos: %f\n", *pos);
if (!context->playback->isHttp && context->playback->isPlaying && !context->playback->isForwarding && !context->playback->BackWard && !context->playback->SlowMotion && !context->playback->isPaused) { if (context->playback->isPlaying && !context->playback->isForwarding && !context->playback->BackWard && !context->playback->SlowMotion && !context->playback->isPaused) {
context->playback->isSeeking = 1; context->playback->isSeeking = 1;
context->output->Command(context, OUTPUT_CLEAR, NULL); context->output->Command(context, OUTPUT_CLEAR, NULL);

View File

@@ -16,8 +16,13 @@ static AVFormatContext* avContext = NULL;
void dump_metadata() void dump_metadata()
{ {
#if LIBAVCODEC_VERSION_MAJOR < 54
AVMetadataTag *tag = NULL; AVMetadataTag *tag = NULL;
while ((tag = av_metadata_get(avContext->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) while ((tag = av_metadata_get(avContext->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX)))
#else
AVDictionaryEntry *tag = NULL;
while ((tag = av_dict_get(avContext->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
#endif
printf("%s: %s\n", tag->key, tag->value); printf("%s: %s\n", tag->key, tag->value);
} }
@@ -42,10 +47,18 @@ int main(int argc,char* argv[])
av_register_all(); av_register_all();
#if LIBAVCODEC_VERSION_MAJOR < 54
if ((err = av_open_input_file(&avContext, file, NULL, 0, NULL)) != 0) { if ((err = av_open_input_file(&avContext, file, NULL, 0, NULL)) != 0) {
#else
if ((err = avformat_open_input(&avContext, file, NULL, 0)) != 0) {
#endif
char error[512]; char error[512];
#if LIBAVCODEC_VERSION_MAJOR < 54
printf("av_open_input_file failed %d (%s)\n", err, file); printf("av_open_input_file failed %d (%s)\n", err, file);
#else
printf("avformat_open_input failed %d (%s)\n", err, file);
#endif
av_strerror(err, error, 512); av_strerror(err, error, 512);
printf("Cause: %s\n", error); printf("Cause: %s\n", error);
@@ -67,10 +80,17 @@ int main(int argc,char* argv[])
if (stream) if (stream)
{ {
#if LIBAVCODEC_VERSION_MAJOR < 54
AVMetadataTag *tag = NULL; AVMetadataTag *tag = NULL;
#else
AVDictionaryEntry *tag = NULL;
#endif
if (stream->metadata != NULL) if (stream->metadata != NULL)
#if LIBAVCODEC_VERSION_MAJOR < 54
while ((tag = av_metadata_get(stream->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) while ((tag = av_metadata_get(stream->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX)))
#else
while ((tag = av_dict_get(stream->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
#endif
printf("%s: %s\n", tag->key, tag->value); printf("%s: %s\n", tag->key, tag->value);
} }
} }