~ubuntu-branches/ubuntu/raring/vice/raring

« back to all changes in this revision

Viewing changes to src/gfxoutputdrv/ffmpegdrv.c

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2009-03-31 00:37:15 UTC
  • mfrom: (1.1.7 upstream) (9.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090331003715-i5yisvcfv7mgz3eh
Tags: 2.1.dfsg-1
* New major upstream release (closes: #495937).
* Add desktop files (closes: #501181).

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include "palette.h"
40
40
#include "resources.h"
41
41
#include "screenshot.h"
42
 
#ifdef HAS_TRANSLATION
43
42
#include "translate.h"
44
 
#endif
45
43
#include "ui.h"
46
44
#include "util.h"
47
45
#include "vsync.h"
49
47
static ffmpegdrv_codec_t avi_audio_codeclist[] = { 
50
48
    { CODEC_ID_MP2, "MP2" },
51
49
    { CODEC_ID_MP3, "MP3" },
 
50
    { CODEC_ID_PCM_S16LE, "PCM uncompressed" },
52
51
    { 0, NULL }
53
52
};
54
53
 
183
182
 
184
183
/*---------- Commandline options --------------------------------------*/
185
184
 
186
 
#ifdef HAS_TRANSLATION
187
 
static const cmdline_option_t cmdline_options[] = {
188
 
    { "-ffmpegaudiobitrate", SET_RESOURCE, 1, NULL, NULL,
189
 
      "FFMPEGAudioBitrate", NULL,
190
 
      IDCLS_P_VALUE, IDCLS_SET_AUDIO_STREAM_BITRATE },
191
 
    { "-ffmpegvideobitrate", SET_RESOURCE, 1, NULL, NULL,
192
 
      "FFMPEGVideoBitrate", NULL,
193
 
      IDCLS_P_VALUE, IDCLS_SET_VIDEO_STREAM_BITRATE },
194
 
    { NULL }
195
 
};
196
 
#else
197
 
static const cmdline_option_t cmdline_options[] = {
198
 
    { "-ffmpegaudiobitrate", SET_RESOURCE, 1, NULL, NULL,
199
 
      "FFMPEGAudioBitrate", NULL,
200
 
      N_("<value>"), N_("Set bitrate for audio stream in media file") },
201
 
    { "-ffmpegvideobitrate", SET_RESOURCE, 1, NULL, NULL,
202
 
      "FFMPEGVideoBitrate", NULL,
203
 
      N_("<value>"), N_("Set bitrate for video stream in media file") },
204
 
    { NULL }
205
 
};
206
 
#endif
 
185
static const cmdline_option_t cmdline_options[] = {
 
186
    { "-ffmpegaudiobitrate", SET_RESOURCE, 1,
 
187
      NULL, NULL, "FFMPEGAudioBitrate", NULL,
 
188
      USE_PARAM_ID, USE_DESCRIPTION_ID,
 
189
      IDCLS_P_VALUE, IDCLS_SET_AUDIO_STREAM_BITRATE,
 
190
      NULL, NULL },
 
191
    { "-ffmpegvideobitrate", SET_RESOURCE, 1,
 
192
      NULL, NULL, "FFMPEGVideoBitrate", NULL,
 
193
      USE_PARAM_ID, USE_DESCRIPTION_ID,
 
194
      IDCLS_P_VALUE, IDCLS_SET_VIDEO_STREAM_BITRATE,
 
195
      NULL, NULL },
 
196
    { NULL }
 
197
};
207
198
 
208
199
int ffmpegdrv_cmdline_options_init(void)
209
200
{
536
527
    c->pix_fmt = PIX_FMT_YUV420P;
537
528
 
538
529
    /* FFV1 isn't strict standard compliant */
539
 
    if (c->codec_id == CODEC_ID_FFV1)
 
530
    if (c->codec_id == CODEC_ID_FFV1) {
540
531
        c->strict_std_compliance = -1;
 
532
        c->pix_fmt = PIX_FMT_RGBA32;
 
533
    }
541
534
 
542
535
    video_st = st;
543
536
    video_pts = 0;
560
553
    (*ffmpeglib.p_dump_format)(ffmpegdrv_oc, 0, ffmpegdrv_oc->filename, 1);
561
554
 
562
555
    if (video_st && (ffmpegdrv_open_video(ffmpegdrv_oc, video_st) < 0)) {
563
 
#ifdef HAS_TRANSLATION
564
556
        ui_error(translate_text(IDGS_FFMPEG_CANNOT_OPEN_VSTREAM));
565
 
#else
566
 
        ui_error(_("ffmpegdrv: Cannot open video stream"));
567
 
#endif
568
557
        screenshot_stop_recording();
569
558
        return -1;
570
559
    }
571
560
    if (audio_st && (ffmpegdrv_open_audio(ffmpegdrv_oc, audio_st) < 0)) {
572
 
#ifdef HAS_TRANSLATION
573
561
        ui_error(translate_text(IDGS_FFMPEG_CANNOT_OPEN_ASTREAM));
574
 
#else
575
 
        ui_error(_("ffmpegdrv: Cannot open audio stream"));
576
 
#endif
577
562
        screenshot_stop_recording();
578
563
        return -1;
579
564
    }
582
567
        if ((*ffmpeglib.p_url_fopen)(&ffmpegdrv_oc->pb, ffmpegdrv_oc->filename,
583
568
                            URL_WRONLY) < 0) 
584
569
        {
585
 
#ifdef HAS_TRANSLATION
586
570
            ui_error(translate_text(IDGS_FFMPEG_CANNOT_OPEN_S), ffmpegdrv_oc->filename);
587
 
#else
588
 
            ui_error(_("ffmpegdrv: Cannot open %s"), ffmpegdrv_oc->filename);
589
 
#endif
590
571
            screenshot_stop_recording();
591
572
            return -1;
592
573
        }
799
780
        ffmpegdrv_close,
800
781
        ffmpegdrv_write,
801
782
        ffmpegdrv_save,
 
783
#ifdef FEATURE_CPUMEMHISTORY
 
784
        ffmpegdrv_record,
 
785
        NULL
 
786
#else
802
787
        ffmpegdrv_record
 
788
#endif
803
789
    },
804
790
/*
805
791
{
833
819
        ffmpegdrv_record
834
820
    },
835
821
*/
836
 
    { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
 
822
    { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
 
823
#ifdef FEATURE_CPUMEMHISTORY
 
824
      NULL,
 
825
#endif
 
826
      NULL }
837
827
};
838
828
 
839
829
void gfxoutput_init_ffmpeg(void)