~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavformat/ffmdec.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:23:28 UTC
  • mfrom: (0.4.7 sid)
  • mto: This revision was merged to the branch mainline in revision 76.
  • Revision ID: package-import@ubuntu.com-20120112222328-8jqdyodym3p84ygu
Tags: 2:1.0~rc4.dfsg1+svn34540-1
* New upstream snapshot
* upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * FFM (ffserver live feed) demuxer
 
2
 * FFM (avserver live feed) demuxer
3
3
 * Copyright (c) 2001 Fabrice Bellard
4
4
 *
5
5
 * This file is part of Libav.
20
20
 */
21
21
 
22
22
#include "libavutil/intreadwrite.h"
 
23
#include "libavutil/intfloat.h"
23
24
#include "avformat.h"
 
25
#include "internal.h"
24
26
#include "ffm.h"
25
 
#if CONFIG_FFSERVER
 
27
#if CONFIG_AVSERVER
26
28
#include <unistd.h>
27
29
 
28
30
int64_t ffm_read_write_index(int fd)
54
56
    ffm->write_index = pos;
55
57
    ffm->file_size = file_size;
56
58
}
57
 
#endif // CONFIG_FFSERVER
 
59
#endif // CONFIG_AVSERVER
58
60
 
59
61
static int ffm_is_avail_data(AVFormatContext *s, int size)
60
62
{
289
291
    for(i=0;i<nb_streams;i++) {
290
292
        char rc_eq_buf[128];
291
293
 
292
 
        st = av_new_stream(s, 0);
 
294
        st = avformat_new_stream(s, NULL);
293
295
        if (!st)
294
296
            goto fail;
295
297
 
296
 
        av_set_pts_info(st, 64, 1, 1000000);
 
298
        avpriv_set_pts_info(st, 64, 1, 1000000);
297
299
 
298
300
        codec = st->codec;
299
301
        /* generic info */
300
302
        codec->codec_id = avio_rb32(pb);
301
303
        codec->codec_type = avio_r8(pb); /* codec_type */
302
304
        codec->bit_rate = avio_rb32(pb);
303
 
        st->quality = avio_rb32(pb);
304
305
        codec->flags = avio_rb32(pb);
305
306
        codec->flags2 = avio_rb32(pb);
306
307
        codec->debug = avio_rb32(pb);
324
325
            codec->rc_max_rate = avio_rb32(pb);
325
326
            codec->rc_min_rate = avio_rb32(pb);
326
327
            codec->rc_buffer_size = avio_rb32(pb);
327
 
            codec->i_quant_factor = av_int2dbl(avio_rb64(pb));
328
 
            codec->b_quant_factor = av_int2dbl(avio_rb64(pb));
329
 
            codec->i_quant_offset = av_int2dbl(avio_rb64(pb));
330
 
            codec->b_quant_offset = av_int2dbl(avio_rb64(pb));
 
328
            codec->i_quant_factor = av_int2double(avio_rb64(pb));
 
329
            codec->b_quant_factor = av_int2double(avio_rb64(pb));
 
330
            codec->i_quant_offset = av_int2double(avio_rb64(pb));
 
331
            codec->b_quant_offset = av_int2double(avio_rb64(pb));
331
332
            codec->dct_algo = avio_rb32(pb);
332
333
            codec->strict_std_compliance = avio_rb32(pb);
333
334
            codec->max_b_frames = avio_rb32(pb);
339
340
            codec->mb_decision = avio_rb32(pb);
340
341
            codec->nsse_weight = avio_rb32(pb);
341
342
            codec->frame_skip_cmp = avio_rb32(pb);
342
 
            codec->rc_buffer_aggressivity = av_int2dbl(avio_rb64(pb));
 
343
            codec->rc_buffer_aggressivity = av_int2double(avio_rb64(pb));
343
344
            codec->codec_tag = avio_rb32(pb);
344
345
            codec->thread_count = avio_r8(pb);
345
346
            codec->coder_type = avio_rb32(pb);
346
347
            codec->me_cmp = avio_rb32(pb);
347
 
            codec->partitions = avio_rb32(pb);
348
348
            codec->me_subpel_quality = avio_rb32(pb);
349
349
            codec->me_range = avio_rb32(pb);
350
350
            codec->keyint_min = avio_rb32(pb);
351
351
            codec->scenechange_threshold = avio_rb32(pb);
352
352
            codec->b_frame_strategy = avio_rb32(pb);
353
 
            codec->qcompress = av_int2dbl(avio_rb64(pb));
354
 
            codec->qblur = av_int2dbl(avio_rb64(pb));
 
353
            codec->qcompress = av_int2double(avio_rb64(pb));
 
354
            codec->qblur = av_int2double(avio_rb64(pb));
355
355
            codec->max_qdiff = avio_rb32(pb);
356
356
            codec->refs = avio_rb32(pb);
357
 
            codec->directpred = avio_rb32(pb);
358
357
            break;
359
358
        case AVMEDIA_TYPE_AUDIO:
360
359
            codec->sample_rate = avio_rb32(pb);
509
508
}
510
509
 
511
510
AVInputFormat ff_ffm_demuxer = {
512
 
    "ffm",
513
 
    NULL_IF_CONFIG_SMALL("FFM (FFserver live feed) format"),
514
 
    sizeof(FFMContext),
515
 
    ffm_probe,
516
 
    ffm_read_header,
517
 
    ffm_read_packet,
518
 
    ffm_close,
519
 
    ffm_seek,
 
511
    .name           = "ffm",
 
512
    .long_name      = NULL_IF_CONFIG_SMALL("FFM (AVserver live feed) format"),
 
513
    .priv_data_size = sizeof(FFMContext),
 
514
    .read_probe     = ffm_probe,
 
515
    .read_header    = ffm_read_header,
 
516
    .read_packet    = ffm_read_packet,
 
517
    .read_close     = ffm_close,
 
518
    .read_seek      = ffm_seek,
520
519
};