Line
Link Here
|
0 |
-- source/blender/blenkernel/intern/writeffmpeg.c 2011-06-22 12:23:10.000000000 -0300 |
0 |
++ source/blender/blenkernel/intern/writeffmpeg.c 2011-07-08 12:24:17.000000000 -0300 |
Lines 2-8
Link Here
|
2 |
* \ingroup bke |
2 |
* \ingroup bke |
3 |
*/ |
3 |
*/ |
4 |
/* |
4 |
/* |
5 |
* $Id: writeffmpeg.c 36960 2011-05-27 23:33:40Z schlaile $ |
5 |
* $Id: writeffmpeg.c 37755 2011-06-23 16:10:48Z campbellbarton $ |
6 |
* |
6 |
* |
7 |
* ffmpeg-write support |
7 |
* ffmpeg-write support |
8 |
* |
8 |
* |
Lines 49-55
Link Here
|
49 |
|
49 |
|
50 |
#include "BLI_blenlib.h" |
50 |
#include "BLI_blenlib.h" |
51 |
|
51 |
|
52 |
#include "AUD_C-API.h" /* must be before BKE_sound.h for define */ |
52 |
#ifdef WITH_AUDASPACE |
|
|
53 |
# include "AUD_C-API.h" |
54 |
#endif |
53 |
|
55 |
|
54 |
#include "BKE_global.h" |
56 |
#include "BKE_global.h" |
55 |
#include "BKE_idprop.h" |
57 |
#include "BKE_idprop.h" |
Lines 89-95
Link Here
|
89 |
static int audio_outbuf_size = 0; |
91 |
static int audio_outbuf_size = 0; |
90 |
static double audio_time = 0.0f; |
92 |
static double audio_time = 0.0f; |
91 |
|
93 |
|
|
|
94 |
#ifdef WITH_AUDASPACE |
92 |
static AUD_Device* audio_mixdown_device = 0; |
95 |
static AUD_Device* audio_mixdown_device = 0; |
|
|
96 |
#endif |
93 |
|
97 |
|
94 |
#define FFMPEG_AUTOSPLIT_SIZE 2000000000 |
98 |
#define FFMPEG_AUTOSPLIT_SIZE 2000000000 |
95 |
|
99 |
|
Lines 103-108
Link Here
|
103 |
} |
107 |
} |
104 |
} |
108 |
} |
105 |
|
109 |
|
|
|
110 |
#ifdef WITH_AUDASPACE |
106 |
static int write_audio_frame(void) |
111 |
static int write_audio_frame(void) |
107 |
{ |
112 |
{ |
108 |
AVCodecContext* c = NULL; |
113 |
AVCodecContext* c = NULL; |
Lines 145-150
Link Here
|
145 |
} |
150 |
} |
146 |
return 0; |
151 |
return 0; |
147 |
} |
152 |
} |
|
|
153 |
#endif // #ifdef WITH_AUDASPACE |
148 |
|
154 |
|
149 |
/* Allocate a temporary frame */ |
155 |
/* Allocate a temporary frame */ |
150 |
static AVFrame* alloc_picture(int pix_fmt, int width, int height) |
156 |
static AVFrame* alloc_picture(int pix_fmt, int width, int height) |
Lines 851-857
Link Here
|
851 |
ffmpeg_autosplit_count = 0; |
857 |
ffmpeg_autosplit_count = 0; |
852 |
|
858 |
|
853 |
success = start_ffmpeg_impl(rd, rectx, recty, reports); |
859 |
success = start_ffmpeg_impl(rd, rectx, recty, reports); |
854 |
|
860 |
#ifdef WITH_AUDASPACE |
855 |
if(audio_stream) |
861 |
if(audio_stream) |
856 |
{ |
862 |
{ |
857 |
AVCodecContext* c = audio_stream->codec; |
863 |
AVCodecContext* c = audio_stream->codec; |
Lines 861-872
Link Here
|
861 |
specs.rate = rd->ffcodecdata.audio_mixrate; |
867 |
specs.rate = rd->ffcodecdata.audio_mixrate; |
862 |
audio_mixdown_device = sound_mixdown(scene, specs, rd->sfra, rd->ffcodecdata.audio_volume); |
868 |
audio_mixdown_device = sound_mixdown(scene, specs, rd->sfra, rd->ffcodecdata.audio_volume); |
863 |
} |
869 |
} |
864 |
|
870 |
#endif |
865 |
return success; |
871 |
return success; |
866 |
} |
872 |
} |
867 |
|
873 |
|
868 |
void end_ffmpeg(void); |
874 |
void end_ffmpeg(void); |
869 |
|
875 |
|
|
|
876 |
#ifdef WITH_AUDASPACE |
870 |
static void write_audio_frames(double to_pts) |
877 |
static void write_audio_frames(double to_pts) |
871 |
{ |
878 |
{ |
872 |
int finished = 0; |
879 |
int finished = 0; |
Lines 878-883
Link Here
|
878 |
} |
885 |
} |
879 |
} |
886 |
} |
880 |
} |
887 |
} |
|
|
888 |
#endif |
881 |
|
889 |
|
882 |
int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports) |
890 |
int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports) |
883 |
{ |
891 |
{ |
Lines 905-912
Link Here
|
905 |
} |
913 |
} |
906 |
} |
914 |
} |
907 |
|
915 |
|
|
|
916 |
#ifdef WITH_AUDASPACE |
908 |
write_audio_frames((frame - rd->sfra) / (((double)rd->frs_sec) / rd->frs_sec_base)); |
917 |
write_audio_frames((frame - rd->sfra) / (((double)rd->frs_sec) / rd->frs_sec_base)); |
909 |
|
918 |
#endif |
910 |
return success; |
919 |
return success; |
911 |
} |
920 |
} |
912 |
|
921 |
|
Lines 920-931
Link Here
|
920 |
write_audio_frames(); |
929 |
write_audio_frames(); |
921 |
}*/ |
930 |
}*/ |
922 |
|
931 |
|
|
|
932 |
#ifdef WITH_AUDASPACE |
923 |
if(audio_mixdown_device) |
933 |
if(audio_mixdown_device) |
924 |
{ |
934 |
{ |
925 |
AUD_closeReadDevice(audio_mixdown_device); |
935 |
AUD_closeReadDevice(audio_mixdown_device); |
926 |
audio_mixdown_device = 0; |
936 |
audio_mixdown_device = 0; |
927 |
} |
937 |
} |
928 |
|
938 |
#endif |
|
|
939 |
|
929 |
if (video_stream && video_stream->codec) { |
940 |
if (video_stream && video_stream->codec) { |
930 |
fprintf(stderr, "Flushing delayed frames...\n"); |
941 |
fprintf(stderr, "Flushing delayed frames...\n"); |
931 |
flush_ffmpeg (); |
942 |
flush_ffmpeg (); |