From 702e73b84d90830062ebe07ba01b72ad59d48d93 Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Mon, 27 Dec 2004 13:13:30 +0000 Subject: [PATCH] Luma and composite fixes git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@575 d19143bc-622f-0410-bfdd-b5b2a6649095 --- docs/services.txt | 30 +- src/framework/mlt_frame.c | 17 +- src/framework/mlt_geometry.c | 2 +- src/modules/core/filter_data_show.c | 54 ++-- src/modules/core/transition_composite.c | 17 +- src/modules/core/transition_luma.c | 13 +- src/modules/data_fx.properties | 392 ++++++++++++------------ src/modules/inigo/producer_inigo.c | 23 +- src/modules/lumas/create_lumas | 41 +-- src/modules/lumas/luma.c | 31 ++ 10 files changed, 348 insertions(+), 272 deletions(-) diff --git a/docs/services.txt b/docs/services.txt index a92de216..5b9d4af5 100644 --- a/docs/services.txt +++ b/docs/services.txt @@ -1079,19 +1079,10 @@ Transitions Constructor Argument - string start - a geometry specification as X,Y:WxH[!][:mix] - - X, Y, W, H are assumed to pixel units unless they - have the suffix '%' - - '!' is a shortcut to specify distort, see below. - - mix is always a 2 digit percentage, defaults to 100. - - default is "85%,5%:10%x10%" + none[*] Initialisation Properties - string end - the ending size and position. - string key[F] - X,Y:WxH[:mix] - set a key frame for geometry between - the in and out. F is a frame number and can be - negative to make it relative to the out point. int in - in point int out - out point string factory - The name of a factory service used as a non-PGM @@ -1102,7 +1093,11 @@ Transitions none Mutable Properties - + + + string geometry - key frame specification + - this is a ; delimited form of the deprecated start, + key[n], end properties int progressive - set to 1 to disable field-based rendering. string distort - when set, causes the B frame image to fill the WxH completely with no regard to B's aspect ratio. @@ -1121,6 +1116,19 @@ Transitions Any property starting with "luma." is passed to the non-PGM luma producer. + Deprecated Properties + + string start - a geometry specification as X,Y:WxH[!][:mix] + - X, Y, W, H are assumed to pixel units unless they + have the suffix '%' + - '!' is a shortcut to specify distort, see below. + - mix is always a 2 digit percentage, defaults to 100. + - default is "85%,5%:10%x10%" + string end - the ending size and position. + string key[F] - X,Y:WxH[:mix] - set a key frame for geometry between + the in and out. F is a frame number and can be + negative to make it relative to the out point. + Dependencies none diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index a0a47326..d8d3c8ae 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -569,7 +569,7 @@ uint8_t *mlt_resize_alpha( uint8_t *input, int owidth, int oheight, int iwidth, { uint8_t *output = NULL; - if ( input != NULL && ( iwidth != owidth || iheight != oheight ) ) + if ( input != NULL && ( iwidth != owidth || iheight != oheight ) && ( owidth > 6 && oheight > 6 ) ) { iwidth = iwidth - ( iwidth % 2 ); owidth = owidth - ( owidth % 2 ); @@ -651,14 +651,21 @@ void mlt_resize_yuv422( uint8_t *output, int owidth, int oheight, uint8_t *input int istride = iwidth * 2; int ostride = owidth * 2; - iwidth = iwidth - ( iwidth % 4 ); - owidth = owidth - ( owidth % 4 ); + iwidth = iwidth - ( iwidth % 2 ); + owidth = owidth - ( owidth % 2 ); //iheight = iheight - ( iheight % 2 ); //oheight = oheight - ( oheight % 2 ); - + // Optimisation point - if ( iwidth == owidth && iheight == oheight ) + if ( output == NULL || input == NULL || ( owidth <= 6 || oheight <= 6 || iwidth <= 6 || oheight <= 6 ) ) + { + return; + } + else if ( iwidth == owidth && iheight == oheight ) + { memcpy( output, input, iheight * istride ); + return; + } // Coordinates (0,0 is middle of output) int y; diff --git a/src/framework/mlt_geometry.c b/src/framework/mlt_geometry.c index 956225ac..8fa30b59 100644 --- a/src/framework/mlt_geometry.c +++ b/src/framework/mlt_geometry.c @@ -279,7 +279,7 @@ int mlt_geometry_parse_item( mlt_geometry this, mlt_geometry_item item, char *va static inline float linearstep( float start, float end, float position, int length ) { float o = ( end - start ) / length; - return start + position * o + 0.5; + return start + position * o; } // Fetch a geometry item for an absolute position diff --git a/src/modules/core/filter_data_show.c b/src/modules/core/filter_data_show.c index db2e6707..b16f8fe4 100644 --- a/src/modules/core/filter_data_show.c +++ b/src/modules/core/filter_data_show.c @@ -44,27 +44,21 @@ static mlt_filter obtain_filter( mlt_filter filter, char *type ) // Obtain the profile_properties if we haven't already if ( profile_properties == NULL ) { + char temp[ 512 ]; + // Get the profile requested - char *profile = mlt_properties_get( filter_properties, "profile" ); + char *profile = mlt_properties_get( filter_properties, "resource" ); - // Load the specified profile or use the default - if ( profile != NULL ) - { - profile_properties = mlt_properties_load( profile ); - } + // If none is specified, pick up the default for this normalisation + if ( profile == NULL ) + sprintf( temp, "%s/feeds/%s/data_fx.properties", mlt_factory_prefix( ), mlt_environment( "MLT_NORMALISATION" ) ); + else if ( strchr( profile, '%' ) ) + sprintf( temp, "%s/feeds/%s/%s", mlt_factory_prefix( ), mlt_environment( "MLT_NORMALISATION" ), strchr( profile, '%' ) + 1 ); else - { - // Sometimes C can be laborious.. - static char *default_file = "/data_fx.properties"; - char *temp = malloc( strlen( mlt_factory_prefix( ) ) + strlen( default_file ) + 1 ); - if ( temp != NULL ) - { - strcpy( temp, mlt_factory_prefix( ) ); - strcat( temp, default_file ); - profile_properties = mlt_properties_load( temp ); - free( temp ); - } - } + strcpy( temp, profile ); + + // Load the specified profile or use the default + profile_properties = mlt_properties_load( temp ); // Store for later retrieval mlt_properties_set_data( filter_properties, "profile_properties", profile_properties, 0, ( mlt_destructor )mlt_properties_close, NULL ); @@ -176,6 +170,9 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format // Fetch the data queue mlt_deque data_queue = mlt_properties_get_data( frame_properties, "data_queue", NULL ); + // Create a new queue for those that we can't handle + mlt_deque temp_queue = mlt_deque_init( ); + // Iterate through each entry on the queue while ( data_queue != NULL && mlt_deque_peek_front( data_queue ) != NULL ) { @@ -183,12 +180,25 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format mlt_properties feed = mlt_deque_pop_front( data_queue ); // Process the data feed... - process_feed( feed, filter, frame ); + if ( process_feed( feed, filter, frame ) == 0 ) + mlt_properties_close( feed ); + else + mlt_deque_push_back( temp_queue, feed ); + } - // Close the feed - mlt_properties_close( feed ); + // Now put the unprocessed feeds back on the stack + while ( data_queue != NULL && mlt_deque_peek_front( temp_queue ) ) + { + // Get the data feed + mlt_properties feed = mlt_deque_pop_front( temp_queue ); + + // Put it back on the data queue + mlt_deque_push_back( data_queue, feed ); } + // Close the temporary queue + mlt_deque_close( temp_queue ); + // Need to get the image return mlt_frame_get_image( frame, image, format, width, height, 1 ); } @@ -224,7 +234,7 @@ mlt_filter filter_data_show_init( char *arg ) mlt_properties properties = MLT_FILTER_PROPERTIES( this ); // Assign the argument (default to titles) - mlt_properties_set( properties, "profile", arg == NULL ? NULL : arg ); + mlt_properties_set( properties, "resource", arg == NULL ? NULL : arg ); // Specify the processing method this->process = filter_process; diff --git a/src/modules/core/transition_composite.c b/src/modules/core/transition_composite.c index 6aef888c..e35d365b 100644 --- a/src/modules/core/transition_composite.c +++ b/src/modules/core/transition_composite.c @@ -878,14 +878,17 @@ mlt_frame composite_copy_region( mlt_transition this, mlt_frame a_frame, mlt_pos x = 0; } - // Copy the region of the image - p = image + y * ss + x * 2; - - while ( h -- ) + if ( w > 0 && h > 0 ) { - inline_memcpy( dest, p, w * 2 ); - dest += ds; - p += ss; + // Copy the region of the image + p = image + y * ss + x * 2; + + while ( h -- ) + { + inline_memcpy( dest, p, w * 2 ); + dest += ds; + p += ss; + } } // Assign this position to the b frame diff --git a/src/modules/core/transition_luma.c b/src/modules/core/transition_luma.c index 248d8485..435aeb30 100644 --- a/src/modules/core/transition_luma.c +++ b/src/modules/core/transition_luma.c @@ -465,6 +465,7 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f mlt_properties_get_int( b_props, "luma.progressive" ); int top_field_first = mlt_properties_get_int( b_props, "top_field_first" ); int reverse = mlt_properties_get_int( properties, "reverse" ); + int invert = mlt_properties_get_int( properties, "invert" ); if ( mlt_properties_get( a_props, "rescale.interp" ) == NULL ) mlt_properties_set( a_props, "rescale.interp", "nearest" ); @@ -480,8 +481,8 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f if ( mix >= 1.0 ) mix -= floor( mix ); - mix = reverse ? 1 - mix : mix; - frame_delta *= reverse ? -1.0 : 1.0; + mix = reverse || invert ? 1 - mix : mix; + frame_delta *= reverse || invert ? -1.0 : 1.0; // Ensure we get scaling on the b_frame mlt_properties_set( b_props, "rescale.interp", "nearest" ); @@ -491,16 +492,16 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f if ( luma_width > 0 && luma_height > 0 && luma_bitmap != NULL ) // Composite the frames using a luma map - luma_composite( a_frame, b_frame, luma_width, luma_height, luma_bitmap, mix, frame_delta, + luma_composite( !invert ? a_frame : b_frame, !invert ? b_frame : a_frame, luma_width, luma_height, luma_bitmap, mix, frame_delta, luma_softness, progressive ? -1 : top_field_first, width, height ); else // Dissolve the frames using the time offset for mix value dissolve_yuv( a_frame, b_frame, mix, *width, *height ); // Extract the a_frame image info - *width = mlt_properties_get_int( a_props, "width" ); - *height = mlt_properties_get_int( a_props, "height" ); - *image = mlt_properties_get_data( a_props, "image", NULL ); + *width = mlt_properties_get_int( !invert ? a_props : b_props, "width" ); + *height = mlt_properties_get_int( !invert ? a_props : b_props, "height" ); + *image = mlt_properties_get_data( !invert ? a_props : b_props, "image", NULL ); return 0; } diff --git a/src/modules/data_fx.properties b/src/modules/data_fx.properties index 8010af0e..49368abf 100644 --- a/src/modules/data_fx.properties +++ b/src/modules/data_fx.properties @@ -18,231 +18,233 @@ # titles=region -titles.description=Titles -titles.properties.markup=filter[1].producer.markup -titles.type.markup=text -titles.period=2 -titles.properties.length[0]=filter[0].composite.out -titles.properties.length[1]=filter[1].composite.out -titles.composite.geometry=5%,70%:90%x20% -titles.filter[0]=watermark -titles.filter[0].resource=colour:0x000000 -titles.filter[0].composite.geometry=0%,0%:100%x100%:0;5=0%,0%:100%x100%:40 -titles.filter[0].composite.titles=1 -titles.filter[1]=watermark -titles.filter[1].resource=pango: -titles.filter[1].producer.markup=Shotcut -titles.filter[1].composite.geometry=0%,0%:100%x100%:0;8=0%,0%:100%x100%:100 -titles.filter[1].composite.titles=1 +.description=Titles +.properties.markup=filter[1].producer.markup +.type.markup=text +.period=2 +.properties.length[0]=filter[0].composite.out +.properties.length[1]=filter[1].composite.out +.composite.geometry=5%,70%:90%x20% +.filter[0]=watermark +.filter[0].resource=colour:0x000000 +.filter[0].composite.geometry=0%,0%:100%x100%:0;5=0%,0%:100%x100%:40 +.filter[0].composite.titles=1 +.filter[1]=watermark +.filter[1].resource=pango: +.filter[1].producer.markup=Shotcut +.filter[1].composite.geometry=0%,0%:100%x100%:0;8=0%,0%:100%x100%:100 +.filter[1].composite.titles=1 # # The top titles filter definition # top-titles=region -top-titles.description=Top Titles -top-titles.properties.markup=filter[1].producer.markup -top-titles.type.markup=text -top-titles.period=2 -top-titles.properties.length[0]=filter[0].composite.out -top-titles.properties.length[1]=filter[1].composite.out -top-titles.composite.geometry=5%,5%:90%x20% -top-titles.filter[0]=watermark -top-titles.filter[0].resource=colour:0x000000 -top-titles.filter[0].composite.geometry=0%,0%:100%x100%:0;5=0%,0%:100%x100%:40 -top-titles.filter[0].composite.titles=1 -top-titles.filter[1]=watermark -top-titles.filter[1].resource=pango: -top-titles.filter[1].producer.markup=Shotcut -top-titles.filter[1].composite.geometry=0%,0%:100%x100%:0;8=0%,0%:100%x100%:100 -top-titles.filter[1].composite.halign=centre -top-titles.filter[1].composite.titles=1 +.description=Top Titles +.properties.markup=filter[1].producer.markup +.type.markup=text +.period=2 +.properties.length[0]=filter[0].composite.out +.properties.length[1]=filter[1].composite.out +.composite.geometry=5%,5%:90%x20% +.filter[0]=watermark +.filter[0].resource=colour:0x000000 +.filter[0].composite.geometry=0%,0%:100%x100%:0;5=0%,0%:100%x100%:40 +.filter[0].composite.titles=1 +.filter[1]=watermark +.filter[1].resource=pango: +.filter[1].producer.markup=Shotcut +.filter[1].composite.geometry=0%,0%:100%x100%:0;8=0%,0%:100%x100%:100 +.filter[1].composite.halign=centre +.filter[1].composite.titles=1 # # OK - Silly example... # tickertape=region -tickertape.description=Tickertape -tickertape.properties.markup=filter[1].producer.markup -tickertape.type.markup=text -tickertape.properties.length[0]=filter[1].composite.out -tickertape.composite.geometry=0%,93%:100%x7% -tickertape.filter[0]=watermark -tickertape.filter[0].resource=colour:0x000000 -tickertape.filter[0].composite.geometry=0%,0%:100%x100%:100 -tickertape.filter[0].composite.titles=1 -tickertape.filter[1]=watermark -tickertape.filter[1].resource=pango: -tickertape.filter[1].producer.markup=Shotcut -tickertape.filter[1].composite.geometry=100%,0%:300%x100%:100;-1=-300%,0%:300%x100%:100 -tickertape.filter[1].producer.font=San 32 -tickertape.filter[1].composite.titles=1 +.description=Tickertape +.properties.markup=filter[1].producer.markup +.type.markup=text +.properties.length[0]=filter[1].composite.out +.composite.geometry=0%,93%:100%x7% +.filter[0]=watermark +.filter[0].resource=colour:0x000000 +.filter[0].composite.geometry=0%,0%:100%x100%:100 +.filter[0].composite.titles=1 +.filter[1]=watermark +.filter[1].resource=pango: +.filter[1].producer.markup=Shotcut +.filter[1].composite.geometry=100%,0%:300%x100%:100;-1=-300%,0%:300%x100%:100 +.filter[1].producer.font=San 32 +.filter[1].composite.titles=1 # # ETV Location # location=region -location.description=Titles -location.properties.markup=filter[1].producer.markup -location.type.markup=text -location.period=2 -location.properties.length[0]=filter[0].composite.out -location.properties.length[1]=filter[1].composite.out -location.composite.geometry=0,80:230x30 -location.filter[0]=watermark -location.filter[0].resource=colour:0x6c010100 -location.filter[0].composite.geometry=-100%,0%:100%x100%:100;25=0%,0%:100%x100%:100 -location.filter[0].composite.titles=1 -location.filter[1]=watermark -location.filter[1].resource=pango: -location.filter[1].producer.markup= -location.filter[1].producer.font=San 24 -location.filter[1].composite.geometry=0%,0%:100%x100%:0;24=0%,0%:100%x100%:0;49=0%,0%:100%x100%:100 -location.filter[1].composite.titles=1 -location.filter[1].composite.halign=right -location.filter[1].composite.valign=center +.description=Titles +.properties.markup=filter[1].producer.markup +.type.markup=text +.period=2 +.properties.length[0]=filter[0].composite.out +.properties.length[1]=filter[1].composite.out +.composite.geometry=0,80:230x30 +.filter[0]=watermark +.filter[0].resource=colour:0x6c010100 +.filter[0].composite.geometry=-100%,0%:100%x100%:100;25=0%,0%:100%x100%:100 +.filter[0].composite.titles=1 +.filter[1]=watermark +.filter[1].resource=pango: +.filter[1].producer.markup= +.filter[1].producer.font=San 24 +.filter[1].composite.geometry=0%,0%:100%x100%:0;24=0%,0%:100%x100%:0;49=0%,0%:100%x100%:100 +.filter[1].composite.titles=1 +.filter[1].composite.halign=right +.filter[1].composite.valign=center courtesy=region -courtesy.description=Titles -courtesy.properties.markup=filter[1].producer.markup -courtesy.type.markup=text -courtesy.period=2 -courtesy.properties.length[0]=filter[0].composite.out -courtesy.properties.length[1]=filter[1].composite.out -courtesy.composite.geometry=0,115:230x30 -courtesy.filter[0]=watermark -courtesy.filter[0].resource=colour:0x6c010100 -courtesy.filter[0].composite.geometry=-100%,0%:100%x100%:0;12=-100%,0%:100%x100%:0;37=0%,0%:100%x100%:100 -courtesy.filter[0].composite.titles=1 -courtesy.filter[1]=watermark -courtesy.filter[1].resource=pango: -courtesy.filter[1].producer.markup=ETV Exclusive -courtesy.filter[1].producer.font=San 24 -courtesy.filter[1].composite.geometry=0%,0%:100%x100%:0;37=0%,0%:100%x100%:0;61=0%,0%:100%x100%:100 -courtesy.filter[1].composite.titles=1 -courtesy.filter[1].composite.halign=right -courtesy.filter[1].composite.valign=right +.description=Titles +.properties.markup=filter[1].producer.markup +.type.markup=text +.period=2 +.properties.length[0]=filter[0].composite.out +.properties.length[1]=filter[1].composite.out +.composite.geometry=0,115:230x30 +.filter[0]=watermark +.filter[0].resource=colour:0x6c010100 +.filter[0].composite.geometry=-100%,0%:100%x100%:0;12=-100%,0%:100%x100%:0;37=0%,0%:100%x100%:100 +.filter[0].composite.titles=1 +.filter[1]=watermark +.filter[1].resource=pango: +.filter[1].producer.markup=ETV Exclusive +.filter[1].producer.font=San 24 +.filter[1].composite.geometry=0%,0%:100%x100%:0;37=0%,0%:100%x100%:0;61=0%,0%:100%x100%:100 +.filter[1].composite.titles=1 +.filter[1].composite.halign=right +.filter[1].composite.valign=right exclusive=region -exclusive.description=Exclusive -exclusive.period=2 -exclusive.properties.length[0]=filter[0].composite.out -exclusive.properties.length[1]=filter[1].composite.out -exclusive.composite.geometry=0,115:230x30 -exclusive.filter[0]=watermark -exclusive.filter[0].resource=colour:0x6c010100 -exclusive.filter[0].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100 -exclusive.filter[0].composite.titles=1 -exclusive.filter[1]=watermark -exclusive.filter[1].resource=pango: -exclusive.filter[1].producer.markup=ETV Exclusive -exclusive.filter[1].producer.font=San 24 -exclusive.filter[1].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100 -exclusive.filter[1].composite.titles=1 -exclusive.filter[1].composite.halign=right -exclusive.filter[1].composite.valign=right +.description=Exclusive +.period=2 +.properties.length[0]=filter[0].composite.out +.properties.length[1]=filter[1].composite.out +.composite.geometry=0,115:230x30 +.filter[0]=watermark +.filter[0].resource=colour:0x6c010100 +.filter[0].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100 +.filter[0].composite.titles=1 +.filter[1]=watermark +.filter[1].resource=pango: +.filter[1].producer.markup=ETV Exclusive +.filter[1].producer.font=San 24 +.filter[1].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100 +.filter[1].composite.titles=1 +.filter[1].composite.halign=right +.filter[1].composite.valign=right file_shot=region -file_shot.description=Titles -file_shot.period=2 -file_shot.properties.length[0]=filter[0].composite.out -file_shot.properties.length[1]=filter[1].composite.out -file_shot.composite.geometry=590,160:80x25 -file_shot.filter[0]=watermark -file_shot.filter[0].resource=colour:0x6c010100 -file_shot.filter[0].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100 -file_shot.filter[0].composite.titles=1 -file_shot.filter[1]=watermark -file_shot.filter[1].resource=pango: -file_shot.filter[1].producer.markup=File Shot -file_shot.filter[1].producer.font=San 20 -file_shot.filter[1].composite.geometry=1%,1%:99%x99%:15;25=1%,1%:99%x99%:100 -file_shot.filter[1].composite.titles=0 -file_shot.filter[1].composite.halign=centre -file_shot.filter[1].composite.valign=centre +.description=Titles +.period=2 +.properties.length[0]=filter[0].composite.out +.properties.length[1]=filter[1].composite.out +.composite.geometry=590,160:80x25 +.filter[0]=watermark +.filter[0].resource=colour:0x6c010100 +.filter[0].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100 +.filter[0].composite.titles=1 +.filter[1]=watermark +.filter[1].resource=pango: +.filter[1].producer.markup=File Shot +.filter[1].producer.font=San 20 +.filter[1].composite.geometry=1%,1%:99%x99%:15;25=1%,1%:99%x99%:100 +.filter[1].composite.titles=0 +.filter[1].composite.halign=centre +.filter[1].composite.valign=centre special=region -special.description=Titles -special.period=2 -special.properties.length[0]=filter[0].composite.out -special.properties.length[1]=filter[1].composite.out -special.composite.geometry=465,375:255x35 -special.filter[0]=watermark -special.filter[0].resource=colour:0x6c010100 -special.filter[0].composite.geometry=100%,0%:100%x100%:0;49=100%,0%:100%x100%:0;74=0%,0%:100%x100%:100 -special.filter[0].composite.titles=1 -special.filter[1]=watermark -special.filter[1].resource=pango: -special.filter[1].producer.markup=Special -special.filter[1].producer.font=San 24 -special.filter[1].composite.geometry=100%,0%:100%x100%:0;49=100%,0%:100%x100%:0;74=0%,0%:100%x100%:100 -special.filter[1].composite.titles=1 -special.filter[1].composite.halign=centre -special.filter[1].composite.valign=centre +.description=Titles +.period=2 +.properties.length[0]=filter[0].composite.out +.properties.length[1]=filter[1].composite.out +.composite.geometry=465,375:255x35 +.filter[0]=watermark +.filter[0].resource=colour:0x6c010100 +.filter[0].composite.geometry=100%,0%:100%x100%:0;49=100%,0%:100%x100%:0;74=0%,0%:100%x100%:100 +.filter[0].composite.titles=1 +.filter[1]=watermark +.filter[1].resource=pango: +.filter[1].producer.markup=Special +.filter[1].producer.font=San 24 +.filter[1].composite.geometry=100%,0%:100%x100%:0;49=100%,0%:100%x100%:0;74=0%,0%:100%x100%:100 +.filter[1].composite.titles=1 +.filter[1].composite.halign=centre +.filter[1].composite.valign=centre ticker=region -ticker.description=Tickertape -ticker.properties.markup=filter[1].producer.markup -ticker.type.markup=text -ticker.properties.length[0]=filter[1].composite.out -ticker.composite.geometry=0,500:722x75 -ticker.filter[0]=watermark -ticker.filter[0].resource=colour:0x6c010100 -ticker.filter[0].composite.geometry=0%,0%:100%x100%:100 -ticker.filter[0].composite.titles=1 -ticker.filter[1]=watermark -ticker.filter[1].resource=pango: -ticker.filter[1].producer.markup=Ticker - provided for reference -ticker.filter[1].composite.geometry=0%,0%:100%x100%:100 -ticker.filter[1].composite.titles=0 -ticker.filter[1].producer.font=San 24 -ticker.filter[1].composite.halign=centre -ticker.filter[1].composite.titles=1 -ticker.filter[1].composite.valign=centre +.description=Tickertape +.properties.markup=filter[1].producer.markup +.type.markup=text +.properties.length[0]=filter[1].composite.out +.composite.geometry=0,500:722x75 +.filter[0]=watermark +.filter[0].resource=colour:0x6c010100 +.filter[0].composite.geometry=0%,0%:100%x100%:100 +.filter[0].composite.titles=1 +.filter[1]=watermark +.filter[1].resource=pango: +.filter[1].producer.markup=Ticker - provided for reference +.filter[1].composite.geometry=0%,0%:100%x100%:100 +.filter[1].composite.titles=0 +.filter[1].producer.font=San 24 +.filter[1].composite.halign=centre +.filter[1].composite.titles=1 +.filter[1].composite.valign=centre super=region -super.description=Transcription -super.properties.0=filter[1].producer.markup -super.properties.1=filter[2].producer.markup -super.properties.align=filter[1].composite.valign -super.properties.length[0]=filter[0].composite.out -super.properties.length[1]=filter[1].composite.out -super.properties.length[2]=filter[2].composite.out -super.period=2 -super.composite.geometry=0,410:720x90 -super.filter[0]=watermark -super.filter[0].resource=colour:0xbbbbbb00 -super.filter[0].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100 -super.filter[0].composite.titles=1 -super.filter[1]=watermark -super.filter[1].resource=pango: -super.filter[1].producer.markup= -super.filter[1].producer.font=San 32 -super.filter[1].producer.fgcolour=0x6c0101ff -super.filter[1].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100 -super.filter[1].composite.titles=1 -super.filter[1].composite.halign=centre -super.filter[1].composite.valign=top -super.filter[2]=watermark -super.filter[2].resource=pango: -super.filter[2].producer.markup= -super.filter[2].producer.font=San 32 -super.filter[2].producer.fgcolour=0x6c0101ff -super.filter[2].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100 -super.filter[2].composite.titles=1 -super.filter[2].composite.halign=centre -super.filter[2].composite.valign=bottom +.description=Transcription +.properties.0=filter[1].producer.markup +.properties.1=filter[2].producer.markup +.properties.align=filter[1].composite.valign +.properties.length[0]=filter[0].composite.out +.properties.length[1]=filter[1].composite.out +.properties.length[2]=filter[2].composite.out +.period=2 +.composite.geometry=0,410:720x90 +.filter[0]=watermark +.filter[0].resource=colour:0xbbbbbb00 +.filter[0].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100 +.filter[0].composite.titles=1 +.filter[0].composite.luma=%luma18.pgm +.filter[0].composite.out=25 +.filter[1]=watermark +.filter[1].resource=pango: +.filter[1].producer.markup= +.filter[1].producer.font=San 32 +.filter[1].producer.fgcolour=0x6c0101ff +.filter[1].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100 +.filter[1].composite.titles=1 +.filter[1].composite.halign=centre +.filter[1].composite.valign=top +.filter[2]=watermark +.filter[2].resource=pango: +.filter[2].producer.markup= +.filter[2].producer.font=San 32 +.filter[2].producer.fgcolour=0x6c0101ff +.filter[2].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100 +.filter[2].composite.titles=1 +.filter[2].composite.halign=centre +.filter[2].composite.valign=bottom obscure=region -obscure.description=Obscure -obscure.properties.geometry=composite.geometry -obscure.properties.resource=resource -obscure.properties.length[0]=composite.out -obscure.composite.geometry= -obscure.resource=rectangle -obscure.composite.refresh=1 -obscure.filter[0]=obscure -obscure.filter[0].start=0,0:100%x100% +.description=Obscure +.properties.geometry=composite.geometry +.properties.resource=resource +.properties.length[0]=composite.out +.composite.geometry= +.resource=rectangle +.composite.refresh=1 +.filter[0]=obscure +.filter[0].start=0,0:100%x100% diff --git a/src/modules/inigo/producer_inigo.c b/src/modules/inigo/producer_inigo.c index 707fb774..2a46fed0 100644 --- a/src/modules/inigo/producer_inigo.c +++ b/src/modules/inigo/producer_inigo.c @@ -79,26 +79,30 @@ static mlt_producer create_producer( mlt_field field, char *file ) static mlt_filter create_attach( mlt_field field, char *id, int track ) { - char *arg = strchr( id, ':' ); + char *temp = strdup( id ); + char *arg = strchr( temp, ':' ); if ( arg != NULL ) *arg ++ = '\0'; - mlt_filter filter = mlt_factory_filter( id, arg ); + mlt_filter filter = mlt_factory_filter( temp, arg ); if ( filter != NULL ) track_service( field, filter, ( mlt_destructor )mlt_filter_close ); + free( temp ); return filter; } static mlt_filter create_filter( mlt_field field, char *id, int track ) { - char *arg = strchr( id, ':' ); + char *temp = strdup( id ); + char *arg = strchr( temp, ':' ); if ( arg != NULL ) *arg ++ = '\0'; - mlt_filter filter = mlt_factory_filter( id, arg ); + mlt_filter filter = mlt_factory_filter( temp, arg ); if ( filter != NULL ) { mlt_field_plant_filter( field, filter, track ); track_service( field, filter, ( mlt_destructor )mlt_filter_close ); } + free( temp ); return filter; } @@ -149,11 +153,12 @@ mlt_producer producer_inigo_init( char **argv ) } else if ( !strcmp( argv[ i ], "-attach" ) || !strcmp( argv[ i ], "-attach-cut" ) || + !strcmp( argv[ i ], "-attach-track" ) || !strcmp( argv[ i ], "-attach-clip" ) ) { int type = !strcmp( argv[ i ], "-attach" ) ? 0 : !strcmp( argv[ i ], "-attach-cut" ) ? 1 : - 2; + !strcmp( argv[ i ], "-attach-track" ) ? 2 : 3; mlt_filter filter = create_attach( field, argv[ ++ i ], track ); if ( producer != NULL && !mlt_producer_is_cut( producer ) ) { @@ -177,11 +182,19 @@ mlt_producer producer_inigo_init( char **argv ) else if ( type == 1 ) mlt_service_attach( ( mlt_service )producer, filter ); else if ( type == 2 ) + mlt_service_attach( ( mlt_service )playlist, filter ); + else if ( type == 3 ) mlt_service_attach( ( mlt_service )mlt_producer_cut_parent( producer ), filter ); properties = MLT_FILTER_PROPERTIES( filter ); mlt_properties_inherit( properties, group ); } + else if ( filter != NULL ) + { + mlt_service_attach( ( mlt_service )playlist, filter ); + properties = MLT_FILTER_PROPERTIES( filter ); + mlt_properties_inherit( properties, group ); + } } else if ( !strcmp( argv[ i ], "-repeat" ) ) { diff --git a/src/modules/lumas/create_lumas b/src/modules/lumas/create_lumas index dcc603c6..71f3db67 100755 --- a/src/modules/lumas/create_lumas +++ b/src/modules/lumas/create_lumas @@ -7,24 +7,25 @@ do mkdir -p $i [ "$i" == "PAL" ] && h=576 || h=480 ./luma -h $h -bpp 16 > $i/luma01.pgm - ./luma -h $h -bpp 16 -offset 32768 -dmirror 1 > $i/luma02.pgm - ./luma -h $h -bpp 16 -bands 8 -rband 1 > $i/luma03.pgm - ./luma -h $h -bpp 16 -hmirror 1 > $i/luma04.pgm - ./luma -h $h -bpp 16 -bands 576 -vmirror 1 > $i/luma05.pgm - ./luma -h $h -bpp 16 -bands 576 -vmirror 0 > $i/luma06.pgm - ./luma -h $h -bpp 16 -bands 8 -rband 0 > $i/luma07.pgm - ./luma -h $h -bpp 16 -offset 32768 -dmirror 1 -hmirror 1 > $i/luma08.pgm - ./luma -h $h -bpp 16 -bands 8 -rband 0 > $i/luma09.pgm - ./luma -h $h -bpp 16 -offset 32768 -dmirror 1 -flip 1 > $i/luma10.pgm - ./luma -h $h -bpp 16 -offset 32768 -dmirror 1 -quart 1 > $i/luma11.pgm - ./luma -h $h -bpp 16 -offset 32768 -dmirror 1 -quart 1 -flip 1 > $i/luma12.pgm - ./luma -h $h -bpp 16 -offset 32768 -dmirror 1 -quart 1 -pflop 1 > $i/luma13.pgm - ./luma -h $h -bpp 16 -offset 32768 -dmirror 1 -quart 1 -flip 1 -pflop 1 > $i/luma14.pgm - ./luma -h $h -bpp 16 -type 1 > $i/luma15.pgm - ./luma -h $h -bpp 16 -type 1 -bands 2 -rband 1 > $i/luma16.pgm - ./luma -h $h -bpp 16 -type 2 > $i/luma17.pgm - ./luma -h $h -bpp 16 -type 2 -quart 1 > $i/luma18.pgm - ./luma -h $h -bpp 16 -type 2 -quart 1 -flip 1 > $i/luma19.pgm - ./luma -h $h -bpp 16 -type 2 -quart 1 -bands 2 > $i/luma20.pgm - ./luma -h $h -bpp 16 -type 3 > $i/luma21.pgm + ./luma -h $h -bpp 16 -bands $h > $i/luma02.pgm + ./luma -h $h -bpp 16 -hmirror 1 > $i/luma03.pgm + ./luma -h $h -bpp 16 -bands $h -vmirror 1 > $i/luma04.pgm + ./luma -h $h -bpp 16 -offset 32768 -dmirror 1 > $i/luma05.pgm + ./luma -h $h -bpp 16 -offset 32768 -dmirror 1 -flip 1 > $i/luma06.pgm + ./luma -h $h -bpp 16 -offset 32768 -dmirror 1 -quart 1 > $i/luma07.pgm + ./luma -h $h -bpp 16 -offset 32768 -dmirror 1 -quart 1 -flip 1 > $i/luma08.pgm + ./luma -h $h -bpp 16 -bands 12 -rband 0 > $i/luma09.pgm + ./luma -h $h -bpp 16 -bands 12 -rband 0 -rotate 1 -flop 1 > $i/luma10.pgm + ./luma -h $h -bpp 16 -bands 12 -rband 1 > $i/luma11.pgm + ./luma -h $h -bpp 16 -bands 12 -rband 1 -vmirror 1 > $i/luma12.pgm + ./luma -h $h -bpp 16 -bands 12 -rband 1 -rotate 1 -flop 1 > $i/luma13.pgm + ./luma -h $h -bpp 16 -bands 12 -rband 1 -rotate 1 -vmirror 1 > $i/luma14.pgm + ./luma -h $h -bpp 16 -offset 32768 -dmirror 1 -hmirror 1 > $i/luma15.pgm + ./luma -h $h -bpp 16 -type 1 > $i/luma16.pgm + ./luma -h $h -bpp 16 -type 1 -bands 2 -rband 1 > $i/luma17.pgm + ./luma -h $h -bpp 16 -type 2 > $i/luma18.pgm + ./luma -h $h -bpp 16 -type 2 -quart 1 > $i/luma19.pgm + ./luma -h $h -bpp 16 -type 2 -quart 1 -flip 1 > $i/luma20.pgm + ./luma -h $h -bpp 16 -type 2 -quart 1 -bands 2 > $i/luma21.pgm + ./luma -h $h -bpp 16 -type 3 > $i/luma22.pgm done diff --git a/src/modules/lumas/luma.c b/src/modules/lumas/luma.c index 76f927a1..ca7b06fb 100644 --- a/src/modules/lumas/luma.c +++ b/src/modules/lumas/luma.c @@ -20,11 +20,13 @@ typedef struct int pflip; int pflop; int quart; + int rotate; } luma; void luma_init( luma *this ) { + memset( this, 0, sizeof( luma ) ); this->type = 0; this->w = 720; this->h = 576; @@ -79,6 +81,13 @@ uint16_t *luma_render( luma *this ) this->h *= 2; } + if ( this->rotate ) + { + int t = this->w; + this->w = this->h; + this->h = t; + } + int max = ( 1 << 16 ) - 1; uint16_t *image = malloc( this->w * this->h * sizeof( uint16_t ) ); uint16_t *end = image + this->w * this->h; @@ -298,6 +307,26 @@ uint16_t *luma_render( luma *this ) } } + if ( this->rotate ) + { + uint16_t *image2 = malloc( this->w * this->h * sizeof( uint16_t ) ); + for ( i = 0; i < this->h; i ++ ) + { + p = image + i * this->w; + r = image2 + this->h - i - 1; + for ( j = 0; j < this->w; j ++ ) + { + *r = *( p ++ ); + r += this->h; + } + } + i = this->w; + this->w = this->h; + this->h = i; + free( image ); + image = image2; + } + return image; } @@ -345,6 +374,8 @@ int main( int argc, char **argv ) this.pflop = atoi( argv[ ++ arg ] ); else if ( !strcmp( argv[ arg ], "-quart" ) ) this.quart = atoi( argv[ ++ arg ] ); + else if ( !strcmp( argv[ arg ], "-rotate" ) ) + this.rotate = atoi( argv[ ++ arg ] ); else fprintf( stderr, "ignoring %s\n", argv[ arg ] ); } -- 2.39.2