mlt_properties_set_data( properties, "test_card_producer", NULL, 0, NULL, NULL );
}
+ // The profile could have changed between a stop and a restart.
+ apply_profile_properties( self, mlt_service_profile( MLT_CONSUMER_SERVICE(self) ), properties );
+
// Set the frame duration in microseconds for the frame-dropping heuristic
int frame_rate_num = mlt_properties_get_int( properties, "frame_rate_num" );
int frame_rate_den = mlt_properties_get_int( properties, "frame_rate_den" );
return self? mlt_properties_get_data( MLT_SERVICE_PROPERTIES( self ), "_profile", NULL ) : NULL;
}
+/** Set the profile for a service.
+ *
+ * \public \memberof mlt_service_s
+ * \param self a service
+ * \param profile the profile to set onto the service
+ */
+
+void mlt_service_set_profile( mlt_service self, mlt_profile profile )
+{
+ mlt_properties_set_data( MLT_SERVICE_PROPERTIES( self ), "_profile", profile, 0, NULL, NULL );
+}
+
/** Destroy a service.
*
* \public \memberof mlt_service_s
extern void mlt_service_apply_filters( mlt_service self, mlt_frame frame, int index );
extern mlt_filter mlt_service_filter( mlt_service self, int index );
extern mlt_profile mlt_service_profile( mlt_service self );
+extern void mlt_service_set_profile( mlt_service self, mlt_profile profile );
extern void mlt_service_close( mlt_service self );
extern void mlt_service_cache_put( mlt_service self, const char *name, void* data, int size, mlt_destructor destructor );
return mlt_profile_dar( instance );
}
+int Profile::is_explicit() const
+{
+ return instance->is_explicit;
+}
+
Properties* Profile::list()
{
return new Properties( mlt_profile_list() );
int display_aspect_num() const;
int display_aspect_den() const;
double dar() const;
+ int is_explicit() const;
static Properties* list();
void from_producer( Producer &producer );
void set_width( int width );
return result == NULL ? NULL : new Filter( result );
}
+void Service::set_profile( Profile &profile )
+{
+ mlt_service_set_profile( get_service( ), profile.get_profile( ) );
+}
int attach( Filter &filter );
int detach( Filter &filter );
Filter *filter( int index );
+ void set_profile( Profile &profile );
};
}
static inline int calculate_mix( uint16_t *luma, int j, int softness, int weight, int alpha, uint32_t step )
{
- return ( ( luma ? smoothstep( luma[ j ], luma[ j ] + softness, step ) : weight ) * alpha ) >> 8;
+ return ( ( luma ? smoothstep( luma[ j ], luma[ j ] + softness, step ) : weight ) * ( alpha + 1 ) ) >> 8;
}
static inline uint8_t sample_mix( uint8_t dest, uint8_t src, int mix )
int stride_src = geometry.sw * bpp;
int stride_dest = width_dest * bpp;
int i_softness = ( 1 << 16 ) * softness;
- int weight = ( ( ( 1 << 16 ) - 1 ) * geometry.item.mix + 50 ) / 100;
+ int weight = ( ( 1 << 16 ) * geometry.item.mix + 50 ) / 100;
uint32_t luma_step = ( ( ( 1 << 16 ) - 1 ) * geometry.item.mix + 50 ) / 100 * ( 1.0 + softness );
// Adjust to consumer scale