X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Fproducer_ppm.c;h=dbd74ac635fdd6d741d96c8a0e89a6d3f5d9c3cc;hb=bf3264b9e340ba5c11cbf59835a8af3db94e0cc2;hp=9865f80a05943760e4e5b26ebd8928d61b0dcc5e;hpb=0b288164cbeb9a3c98107d439d86844be13ba910;p=melted diff --git a/src/modules/core/producer_ppm.c b/src/modules/core/producer_ppm.c index 9865f80..dbd74ac 100644 --- a/src/modules/core/producer_ppm.c +++ b/src/modules/core/producer_ppm.c @@ -3,19 +3,19 @@ * Copyright (C) 2003-2004 Ushodaya Enterprises Limited * Author: Charles Yates * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "producer_ppm.h" @@ -45,10 +45,10 @@ mlt_producer producer_ppm_init( void *command ) if ( this != NULL && mlt_producer_init( &this->parent, this ) == 0 ) { mlt_producer producer = &this->parent; - mlt_properties properties = mlt_producer_properties( producer ); + mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer ); producer->get_frame = producer_get_frame; - producer->close = producer_close; + producer->close = ( mlt_destructor )producer_close; if ( command != NULL ) { @@ -69,7 +69,7 @@ mlt_producer producer_ppm_init( void *command ) static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable ) { // Get the frames properties - mlt_properties properties = mlt_frame_properties( this ); + mlt_properties properties = MLT_FRAME_PROPERTIES( this ); if ( mlt_properties_get_int( properties, "has_image" ) ) { @@ -162,7 +162,7 @@ static void producer_ppm_position( producer_ppm this, uint64_t requested ) static int producer_get_audio( mlt_frame this, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples ) { // Get the frames properties - mlt_properties properties = mlt_frame_properties( this ); + mlt_properties properties = MLT_FRAME_PROPERTIES( this ); FILE *pipe = mlt_properties_get_data( properties, "audio.pipe", NULL ); @@ -214,7 +214,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i producer_ppm_position( this, mlt_producer_frame( producer ) ); // Get the frames properties - mlt_properties properties = mlt_frame_properties( *frame ); + mlt_properties properties = MLT_FRAME_PROPERTIES( *frame ); FILE *video = this->video; FILE *audio = this->audio; @@ -234,7 +234,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i mlt_properties_set_int( properties, "height", height ); mlt_properties_set_int( properties, "has_image", 1 ); mlt_properties_set_int( properties, "progressive", 1 ); - mlt_properties_set_double( properties, "aspect_ratio", ( double )width / height ); + mlt_properties_set_double( properties, "aspect_ratio", 1 ); // Push the image callback mlt_frame_push_get_image( *frame, producer_get_image ); @@ -249,7 +249,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i mlt_properties_set_data( properties, "audio.pipe", audio, 0, NULL, NULL ); // Hmm - register audio callback - ( *frame )->get_audio = producer_get_audio; + mlt_frame_push_audio( *frame, producer_get_audio ); // Update timecode on the frame we're creating mlt_frame_set_position( *frame, mlt_producer_position( producer ) ); @@ -272,4 +272,3 @@ static void producer_close( mlt_producer parent ) mlt_producer_close( parent ); free( this ); } -