Commit 985180a1 authored by Fabrice Bellard's avatar Fabrice Bellard

added fake codec CODEC_ID_MPEG2TS of type CODEC_TYPE_DATA (needed for simpler...

added fake codec CODEC_ID_MPEG2TS of type CODEC_TYPE_DATA (needed for simpler handling of raw transport streams in ffserver and RTP - better solutions are welcomed)

Originally committed as revision 2445 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b623bbcb
...@@ -16,7 +16,7 @@ extern "C" { ...@@ -16,7 +16,7 @@ extern "C" {
#define FFMPEG_VERSION_INT 0x000408 #define FFMPEG_VERSION_INT 0x000408
#define FFMPEG_VERSION "0.4.8" #define FFMPEG_VERSION "0.4.8"
#define LIBAVCODEC_BUILD 4687 #define LIBAVCODEC_BUILD 4688
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
#define LIBAVCODEC_VERSION FFMPEG_VERSION #define LIBAVCODEC_VERSION FFMPEG_VERSION
...@@ -117,6 +117,9 @@ enum CodecID { ...@@ -117,6 +117,9 @@ enum CodecID {
CODEC_ID_ROQ_DPCM, CODEC_ID_ROQ_DPCM,
CODEC_ID_INTERPLAY_DPCM, CODEC_ID_INTERPLAY_DPCM,
CODEC_ID_XAN_DPCM, CODEC_ID_XAN_DPCM,
CODEC_ID_MPEG2TS, /* _FAKE_ codec to indicate a raw MPEG2 transport
stream (only used by libavformat) */
}; };
/* CODEC_ID_MP3LAME is absolete */ /* CODEC_ID_MP3LAME is absolete */
...@@ -126,6 +129,7 @@ enum CodecType { ...@@ -126,6 +129,7 @@ enum CodecType {
CODEC_TYPE_UNKNOWN = -1, CODEC_TYPE_UNKNOWN = -1,
CODEC_TYPE_VIDEO, CODEC_TYPE_VIDEO,
CODEC_TYPE_AUDIO, CODEC_TYPE_AUDIO,
CODEC_TYPE_DATA,
}; };
/** /**
......
...@@ -523,6 +523,10 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) ...@@ -523,6 +523,10 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
else if (enc->sub_id == 1) else if (enc->sub_id == 1)
codec_name = "mp1"; codec_name = "mp1";
} }
} else if (enc->codec_id == CODEC_ID_MPEG2TS) {
/* fake mpeg2 transport stream codec (currently not
registered) */
codec_name = "mpeg2ts";
} else if (enc->codec_name[0] != '\0') { } else if (enc->codec_name[0] != '\0') {
codec_name = enc->codec_name; codec_name = enc->codec_name;
} else { } else {
...@@ -605,6 +609,10 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) ...@@ -605,6 +609,10 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
break; break;
} }
break; break;
case CODEC_TYPE_DATA:
snprintf(buf, buf_size, "Data: %s", codec_name);
bitrate = enc->bit_rate;
break;
default: default:
av_abort(); av_abort();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment