/*
- * mlt_geometry.h -- provides the geometry API
+ * mlt_geometry.c -- provides the geometry API
* Copyright (C) 2004-2005 Ushodaya Enterprises Limited
* Author: Charles Yates <charles.yates@pandora.be>
*
- * 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 "mlt_geometry.h"
#include "mlt_tokeniser.h"
#include "mlt_factory.h"
+#include "mlt_profile.h"
#include <stdio.h>
#include <stdlib.h>
if ( this->local != NULL )
{
geometry self = this->local;
- char *normalisation = mlt_environment( "MLT_NORMALISATION" );
self->nw = 720;
- if ( normalisation == NULL || strcmp( normalisation, "NTSC" ) )
- self->nh = 576;
- else
- self->nh = 480;
+ self->nh = 576;
}
else
{
geometry_item prev = current->prev;
geometry_item next = current->next;
- float prev_value = 0;
- float next_value = 0;
- float value = 0;
+ double prev_value = 0;
+ double next_value = 0;
+ double value = 0;
while( prev != NULL && !prev->data.f[ i ] ) prev = prev->prev;
while( next != NULL && !next->data.f[ i ] ) next = next->next;
// Get the local/private structure
geometry self = this->local;
- // return the length
+ // set the length
self->length = length;
}
else
{
memset( item, 0, sizeof( struct mlt_geometry_item_s ) );
+ item->frame = position;
item->mix = 100;
}
char *mlt_geometry_serialise_cut( mlt_geometry this, int in, int out )
{
+ geometry self = this->local;
struct mlt_geometry_item_s item;
char *ret = malloc( 1000 );
int used = 0;
if ( mlt_geometry_fetch( this, &item, item.frame ) )
break;
+ // If the first key is larger than the current position
+ // then do nothing here
+ if ( self->item->data.frame > item.frame )
+ {
+ item.frame ++;
+ continue;
+ }
+
// To ensure correct seeding, ensure all values are fixed
item.f[0] = 1;
item.f[1] = 1;