[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14847] trunk/blender/source/blender: == FFMPEG ==
Peter Schlaile
peter at schlaile.de
Thu May 15 08:47:59 CEST 2008
Revision: 14847
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14847
Author: schlaile
Date: 2008-05-15 08:47:54 +0200 (Thu, 15 May 2008)
Log Message:
-----------
== FFMPEG ==
Added additional entry, so that ffmpeg encoding options can
be added using their name instead of "the menu(tm)".
Modified Paths:
--------------
trunk/blender/source/blender/include/butspace.h
trunk/blender/source/blender/src/buttons_scene.c
Modified: trunk/blender/source/blender/include/butspace.h
===================================================================
--- trunk/blender/source/blender/include/butspace.h 2008-05-14 20:22:57 UTC (rev 14846)
+++ trunk/blender/source/blender/include/butspace.h 2008-05-15 06:47:54 UTC (rev 14847)
@@ -359,6 +359,8 @@
#define B_SET_ZBLUR 1644
#define B_ADD_RENDERLAYER 1645
#define B_SET_PASS 1646
+#define B_ADD_FFMPEG_VIDEO_OPTION 1647
+#define B_ADD_FFMPEG_AUDIO_OPTION 1648
#define B_SEQ_BUT_PLUGIN 1691
#define B_SEQ_BUT_RELOAD 1692
Modified: trunk/blender/source/blender/src/buttons_scene.c
===================================================================
--- trunk/blender/source/blender/src/buttons_scene.c 2008-05-14 20:22:57 UTC (rev 14846)
+++ trunk/blender/source/blender/src/buttons_scene.c 2008-05-15 06:47:54 UTC (rev 14847)
@@ -1404,6 +1404,8 @@
#ifdef WITH_FFMPEG
static void set_ffmpeg_preset(int preset);
+static int ffmpeg_property_add_string(const char * type, const char * str);
+static char ffmpeg_option_to_add[255] = "";
#endif
void do_render_panels(unsigned short event)
@@ -1691,6 +1693,20 @@
}
allqueue(REDRAWBUTSSCENE, 0);
allqueue(REDRAWOOPS, 0);
+#ifdef WITH_FFMPEG
+ case B_ADD_FFMPEG_AUDIO_OPTION:
+ if (ffmpeg_property_add_string("audio", ffmpeg_option_to_add)){
+ *ffmpeg_option_to_add = 0;
+ }
+ allqueue(REDRAWBUTSSCENE, 0);
+ break;
+ case B_ADD_FFMPEG_VIDEO_OPTION:
+ if (ffmpeg_property_add_string("video", ffmpeg_option_to_add)){
+ *ffmpeg_option_to_add = 0;
+ }
+ allqueue(REDRAWBUTSSCENE, 0);
+ break;
+#endif
}
}
@@ -2393,14 +2409,18 @@
AVCodecContext c;
const AVOption * o = 0;
const AVOption * p = 0;
- char name[128];
+ char name_[128];
+ char * name;
char * param;
IDProperty * prop;
avcodec_get_context_defaults(&c);
- strncpy(name, str, 128);
+ strncpy(name_, str, 128);
+ name = name_;
+ while (*name == ' ') name++;
+
param = strchr(name, ':');
if (!param) {
@@ -2664,11 +2684,27 @@
static int render_panel_ffmpeg_properties(uiBlock *block, const char * type,
int xofs, int yofs)
{
+ short event = B_NOP;
+
yofs -= 5;
+
+ if (strcmp(type, "audio") == 0) {
+ event = B_ADD_FFMPEG_AUDIO_OPTION;
+ } else if (strcmp(type, "video") == 0) {
+ event = B_ADD_FFMPEG_VIDEO_OPTION;
+ }
+
+ uiDefBut(block, TEX, event, "", xofs, yofs,
+ 170, 19, ffmpeg_option_to_add, 0.0, 255.0, 100, 0,
+ "FFMPEG option to add");
+ uiDefBut(block, BUT, event, "Add", xofs+170,yofs,
+ 30, 19, 0, 0, 0, 0, 0,
+ "Add FFMPEG option");
+
uiDefBlockBut(block, ffmpeg_property_add_menu, (void*) type,
- "Add FFMPEG Expert Option", xofs, yofs, 240, 20,
- "");
+ "Menu", xofs + 200, yofs, 40, 20,
+ "Add FFMPEG option using menu");
yofs -= 20;
if (G.scene->r.ffcodecdata.properties) {
More information about the Bf-blender-cvs
mailing list