summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-07-05 09:09:15 +0000
committerAnton Khirnov <anton@khirnov.net>2014-07-09 13:35:07 +0000
commitf6ee61fb05482c617f5deee29a190d8ff483b3d1 (patch)
treed2d6d3d48c986270164e280c06deadd724bc5b24 /libavformat
parent3f3232a371cc88696184d9aef1f812656264e56c (diff)
downloadffmpeg-streaming-f6ee61fb05482c617f5deee29a190d8ff483b3d1.zip
ffmpeg-streaming-f6ee61fb05482c617f5deee29a190d8ff483b3d1.tar.gz
lavc: export DV profile API used by muxer/demuxer as public
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/dv.c15
-rw-r--r--libavformat/dvenc.c6
2 files changed, 11 insertions, 10 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c
index d7d62f1..da201a3 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -39,7 +39,7 @@
#include "dv.h"
struct DVDemuxContext {
- const DVprofile* sys; /* Current DV profile. E.g.: 525/60, 625/50 */
+ const AVDVProfile* sys; /* Current DV profile. E.g.: 525/60, 625/50 */
AVFormatContext* fctx;
AVStream* vst;
AVStream* ast[4];
@@ -109,7 +109,7 @@ static const int dv_audio_frequency[3] = {
* are converted into 16bit linear ones.
*/
static int dv_extract_audio(uint8_t *frame, uint8_t **ppcm,
- const DVprofile *sys)
+ const AVDVProfile *sys)
{
int size, chan, i, j, d, of, smpls, freq, quant, half_ch;
uint16_t lc, rc;
@@ -347,7 +347,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
uint8_t *ppcm[5] = { 0 };
if (buf_size < DV_PROFILE_BYTES ||
- !(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
+ !(c->sys = av_dv_frame_profile(c->sys, buf, buf_size)) ||
buf_size < c->sys->frame_size) {
return -1; /* Broken frame, or not enough data */
}
@@ -395,7 +395,8 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
int64_t timestamp, int flags)
{
// FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
- const DVprofile *sys = avpriv_dv_codec_profile(c->vst->codec);
+ const AVDVProfile *sys = av_dv_codec_profile(c->vst->codec->width, c->vst->codec->height,
+ c->vst->codec->pix_fmt);
int64_t offset;
int64_t size = avio_size(s->pb) - s->data_offset;
int64_t max_offset = ((size - 1) / sys->frame_size) * sys->frame_size;
@@ -460,9 +461,9 @@ static int dv_read_header(AVFormatContext *s)
avio_seek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
return AVERROR(EIO);
- c->dv_demux->sys = avpriv_dv_frame_profile(c->dv_demux->sys,
- c->buf,
- DV_PROFILE_BYTES);
+ c->dv_demux->sys = av_dv_frame_profile(c->dv_demux->sys,
+ c->buf,
+ DV_PROFILE_BYTES);
if (!c->dv_demux->sys) {
av_log(s, AV_LOG_ERROR,
"Can't determine profile of DV input stream.\n");
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index 66d848c..a33973f 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -41,7 +41,7 @@
#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
struct DVMuxContext {
- const DVprofile* sys; /* current DV profile, e.g.: 525/60, 625/50 */
+ const AVDVProfile* sys; /* current DV profile, e.g.: 525/60, 625/50 */
int n_ast; /* number of stereo audio streams (up to 2) */
AVStream *ast[2]; /* stereo audio streams */
AVFifoBuffer *audio_data[2]; /* FIFO for storing excessive amounts of PCM */
@@ -67,7 +67,7 @@ static const int dv_aaux_packs_dist[12][9] = {
{ 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
};
-static int dv_audio_frame_size(const DVprofile* sys, int frame)
+static int dv_audio_frame_size(const AVDVProfile* sys, int frame)
{
return sys->audio_samples_dist[frame % (sizeof(sys->audio_samples_dist) /
sizeof(sys->audio_samples_dist[0]))];
@@ -328,7 +328,7 @@ static DVMuxContext* dv_init_mux(AVFormatContext* s)
c->ast[i]->codec->channels != 2))
goto bail_out;
}
- c->sys = avpriv_dv_codec_profile(vst->codec);
+ c->sys = av_dv_codec_profile(vst->codec->width, vst->codec->height, vst->codec->pix_fmt);
if (!c->sys)
goto bail_out;
OpenPOWER on IntegriCloud