From ecbe55c1ab5a3f4d9801b29f36041ce1b2384b96 Mon Sep 17 00:00:00 2001 From: ddennedy Date: Thu, 12 Feb 2004 01:50:09 +0000 Subject: [PATCH] remove child mlt dir git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@142 d19143bc-622f-0410-bfdd-b5b2a6649095 --- mlt/Makefile | 14 - mlt/README | 135 ---- mlt/configure | 54 -- mlt/docs/dvcp.txt | 336 --------- mlt/docs/inigo.txt | 286 -------- mlt/docs/services.txt | 664 ----------------- mlt/docs/testing-20040110.txt | 38 - mlt/docs/testing.txt | 612 ---------------- mlt/docs/valerie.txt | 861 ---------------------- mlt/setenv | 21 - mlt/src/albino/Makefile | 27 - mlt/src/albino/albino.c | 100 --- mlt/src/framework/Makefile | 41 -- mlt/src/framework/config.h | 10 - mlt/src/framework/configure | 1 - mlt/src/framework/mlt.h | 47 -- mlt/src/framework/mlt_consumer.c | 108 --- mlt/src/framework/mlt_consumer.h | 57 -- mlt/src/framework/mlt_factory.c | 152 ---- mlt/src/framework/mlt_factory.h | 34 - mlt/src/framework/mlt_field.c | 159 ----- mlt/src/framework/mlt_field.h | 36 - mlt/src/framework/mlt_filter.c | 187 ----- mlt/src/framework/mlt_filter.h | 60 -- mlt/src/framework/mlt_frame.c | 869 ----------------------- mlt/src/framework/mlt_frame.h | 99 --- mlt/src/framework/mlt_manager.h | 26 - mlt/src/framework/mlt_multitrack.c | 376 ---------- mlt/src/framework/mlt_multitrack.h | 40 - mlt/src/framework/mlt_playlist.c | 646 ----------------- mlt/src/framework/mlt_playlist.h | 66 -- mlt/src/framework/mlt_producer.c | 271 ------- mlt/src/framework/mlt_producer.h | 66 -- mlt/src/framework/mlt_properties.c | 361 ---------- mlt/src/framework/mlt_properties.h | 58 -- mlt/src/framework/mlt_property.c | 263 ------- mlt/src/framework/mlt_property.h | 86 --- mlt/src/framework/mlt_repository.c | 210 ------ mlt/src/framework/mlt_repository.h | 39 - mlt/src/framework/mlt_service.c | 293 -------- mlt/src/framework/mlt_service.h | 80 --- mlt/src/framework/mlt_tractor.c | 208 ------ mlt/src/framework/mlt_tractor.h | 33 - mlt/src/framework/mlt_transition.c | 223 ------ mlt/src/framework/mlt_transition.h | 67 -- mlt/src/framework/mlt_types.h | 59 -- mlt/src/humperdink/Makefile | 29 - mlt/src/humperdink/client.c | 1026 --------------------------- mlt/src/humperdink/client.h | 66 -- mlt/src/humperdink/io.c | 204 ------ mlt/src/humperdink/io.h | 36 - mlt/src/humperdink/remote.c | 74 -- mlt/src/inigo/Makefile | 28 - mlt/src/inigo/inigo.c | 282 -------- mlt/src/inigo/io.c | 208 ------ mlt/src/inigo/io.h | 45 -- mlt/src/miracle/Makefile | 40 - mlt/src/miracle/configure | 1 - mlt/src/miracle/miracle.c | 108 --- mlt/src/miracle/miracle_commands.c | 243 ------- mlt/src/miracle/miracle_commands.h | 52 -- mlt/src/miracle/miracle_connection.c | 248 ------- mlt/src/miracle/miracle_connection.h | 91 --- mlt/src/miracle/miracle_local.c | 459 ------------ mlt/src/miracle/miracle_local.h | 41 -- mlt/src/miracle/miracle_log.c | 57 -- mlt/src/miracle/miracle_log.h | 43 -- mlt/src/miracle/miracle_server.c | 272 ------- mlt/src/miracle/miracle_server.h | 70 -- mlt/src/miracle/miracle_unit.c | 645 ----------------- mlt/src/miracle/miracle_unit.h | 81 --- mlt/src/miracle/miracle_unit_commands.c | 421 ----------- mlt/src/miracle/miracle_unit_commands.h | 57 -- mlt/src/modules/Makefile | 19 - mlt/src/modules/configure | 26 - mlt/src/modules/core/Makefile | 35 - mlt/src/modules/core/configure | 25 - mlt/src/modules/core/factory.c | 70 -- mlt/src/modules/core/filter_deinterlace.c | 116 --- mlt/src/modules/core/filter_deinterlace.h | 28 - mlt/src/modules/core/filter_gamma.c | 85 --- mlt/src/modules/core/filter_gamma.h | 28 - mlt/src/modules/core/filter_greyscale.c | 73 -- mlt/src/modules/core/filter_greyscale.h | 28 - mlt/src/modules/core/filter_resize.c | 74 -- mlt/src/modules/core/filter_resize.h | 28 - mlt/src/modules/core/filter_volume.c | 86 --- mlt/src/modules/core/filter_volume.h | 28 - mlt/src/modules/core/producer_ppm.c | 272 ------- mlt/src/modules/core/producer_ppm.h | 29 - mlt/src/modules/core/transition_composite.c | 126 ---- mlt/src/modules/core/transition_composite.h | 28 - mlt/src/modules/core/transition_luma.c | 358 ---------- mlt/src/modules/core/transition_luma.h | 28 - mlt/src/modules/core/transition_mix.c | 111 --- mlt/src/modules/core/transition_mix.h | 28 - mlt/src/modules/dv/Makefile | 30 - mlt/src/modules/dv/configure | 15 - mlt/src/modules/dv/consumer_libdv.c | 395 ---------- mlt/src/modules/dv/consumer_libdv.h | 28 - mlt/src/modules/dv/factory.c | 49 -- mlt/src/modules/dv/producer_libdv.c | 336 --------- mlt/src/modules/dv/producer_libdv.h | 28 - mlt/src/modules/ffmpeg/Makefile | 29 - mlt/src/modules/ffmpeg/audio.sh | 16 - mlt/src/modules/ffmpeg/configure | 19 - mlt/src/modules/ffmpeg/consumer_ffmpeg.c | 279 -------- mlt/src/modules/ffmpeg/consumer_ffmpeg.h | 28 - mlt/src/modules/ffmpeg/factory.c | 52 -- mlt/src/modules/ffmpeg/filter_ffmpeg_dub.c | 142 ---- mlt/src/modules/ffmpeg/filter_ffmpeg_dub.h | 28 - mlt/src/modules/ffmpeg/producer_ffmpeg.c | 555 --------------- mlt/src/modules/ffmpeg/producer_ffmpeg.h | 28 - mlt/src/modules/ffmpeg/video.sh | 16 - mlt/src/modules/gtk2/Makefile | 30 - mlt/src/modules/gtk2/configure | 12 - mlt/src/modules/gtk2/factory.c | 49 -- mlt/src/modules/gtk2/producer_pango.c | 452 ------------ mlt/src/modules/gtk2/producer_pango.h | 37 - mlt/src/modules/gtk2/producer_pixbuf.c | 346 --------- mlt/src/modules/gtk2/producer_pixbuf.h | 45 -- mlt/src/modules/inigo/Makefile | 27 - mlt/src/modules/inigo/configure | 11 - mlt/src/modules/inigo/factory.c | 46 -- mlt/src/modules/inigo/producer_inigo.c | 250 ------- mlt/src/modules/inigo/producer_inigo.h | 28 - mlt/src/modules/resample/Makefile | 29 - mlt/src/modules/resample/configure | 11 - mlt/src/modules/resample/factory.c | 46 -- mlt/src/modules/resample/filter_resample.c | 152 ---- mlt/src/modules/resample/filter_resample.h | 28 - mlt/src/modules/sdl/Makefile | 29 - mlt/src/modules/sdl/configure | 11 - mlt/src/modules/sdl/consumer_sdl.c | 584 --------------- mlt/src/modules/sdl/consumer_sdl.h | 28 - mlt/src/modules/sdl/factory.c | 46 -- mlt/src/modules/westley/Makefile | 30 - mlt/src/modules/westley/configure | 15 - mlt/src/modules/westley/consumer_westley.c | 312 -------- mlt/src/modules/westley/consumer_westley.h | 28 - mlt/src/modules/westley/factory.c | 49 -- mlt/src/modules/westley/producer_westley.c | 78 -- mlt/src/modules/westley/producer_westley.h | 28 - mlt/src/tests/Makefile | 35 - mlt/src/tests/charlie.c | 191 ----- mlt/src/tests/clock16ntsc.pgm | Bin 691217 -> 0 bytes mlt/src/tests/clock16pal.pgm | Bin 829457 -> 0 bytes mlt/src/tests/dan.c | 102 --- mlt/src/tests/dissolve.c | 71 -- mlt/src/tests/io.c | 208 ------ mlt/src/tests/io.h | 45 -- mlt/src/tests/luma.c | 75 -- mlt/src/tests/pango.c | 78 -- mlt/src/tests/pixbuf.c | 73 -- mlt/src/tests/setenv | 7 - mlt/src/tests/test.png | Bin 1352 -> 0 bytes mlt/src/valerie/Makefile | 36 - mlt/src/valerie/configure | 1 - mlt/src/valerie/valerie.c | 875 ----------------------- mlt/src/valerie/valerie.h | 256 ------- mlt/src/valerie/valerie_notifier.c | 142 ---- mlt/src/valerie/valerie_notifier.h | 61 -- mlt/src/valerie/valerie_parser.c | 131 ---- mlt/src/valerie/valerie_parser.h | 67 -- mlt/src/valerie/valerie_remote.c | 260 ------- mlt/src/valerie/valerie_remote.h | 41 -- mlt/src/valerie/valerie_response.c | 244 ------- mlt/src/valerie/valerie_response.h | 59 -- mlt/src/valerie/valerie_socket.c | 175 ----- mlt/src/valerie/valerie_socket.h | 56 -- mlt/src/valerie/valerie_status.c | 160 ----- mlt/src/valerie/valerie_status.h | 83 --- mlt/src/valerie/valerie_tokeniser.c | 172 ----- mlt/src/valerie/valerie_tokeniser.h | 55 -- mlt/src/valerie/valerie_util.c | 77 -- mlt/src/valerie/valerie_util.h | 37 - 176 files changed, 0 insertions(+), 23918 deletions(-) delete mode 100644 mlt/ChangeLog delete mode 100644 mlt/Makefile delete mode 100644 mlt/README delete mode 100755 mlt/configure delete mode 100644 mlt/docs/dvcp.txt delete mode 100644 mlt/docs/inigo.txt delete mode 100644 mlt/docs/services.txt delete mode 100644 mlt/docs/testing-20040110.txt delete mode 100644 mlt/docs/testing.txt delete mode 100644 mlt/docs/valerie.txt delete mode 100644 mlt/setenv delete mode 100644 mlt/src/albino/Makefile delete mode 100644 mlt/src/albino/albino.c delete mode 100644 mlt/src/framework/Makefile delete mode 100644 mlt/src/framework/config.h delete mode 100755 mlt/src/framework/configure delete mode 100644 mlt/src/framework/mlt.h delete mode 100644 mlt/src/framework/mlt_consumer.c delete mode 100644 mlt/src/framework/mlt_consumer.h delete mode 100644 mlt/src/framework/mlt_factory.c delete mode 100644 mlt/src/framework/mlt_factory.h delete mode 100644 mlt/src/framework/mlt_field.c delete mode 100644 mlt/src/framework/mlt_field.h delete mode 100644 mlt/src/framework/mlt_filter.c delete mode 100644 mlt/src/framework/mlt_filter.h delete mode 100644 mlt/src/framework/mlt_frame.c delete mode 100644 mlt/src/framework/mlt_frame.h delete mode 100644 mlt/src/framework/mlt_manager.h delete mode 100644 mlt/src/framework/mlt_multitrack.c delete mode 100644 mlt/src/framework/mlt_multitrack.h delete mode 100644 mlt/src/framework/mlt_playlist.c delete mode 100644 mlt/src/framework/mlt_playlist.h delete mode 100644 mlt/src/framework/mlt_producer.c delete mode 100644 mlt/src/framework/mlt_producer.h delete mode 100644 mlt/src/framework/mlt_properties.c delete mode 100644 mlt/src/framework/mlt_properties.h delete mode 100644 mlt/src/framework/mlt_property.c delete mode 100644 mlt/src/framework/mlt_property.h delete mode 100644 mlt/src/framework/mlt_repository.c delete mode 100644 mlt/src/framework/mlt_repository.h delete mode 100644 mlt/src/framework/mlt_service.c delete mode 100644 mlt/src/framework/mlt_service.h delete mode 100644 mlt/src/framework/mlt_tractor.c delete mode 100644 mlt/src/framework/mlt_tractor.h delete mode 100644 mlt/src/framework/mlt_transition.c delete mode 100644 mlt/src/framework/mlt_transition.h delete mode 100644 mlt/src/framework/mlt_types.h delete mode 100644 mlt/src/humperdink/Makefile delete mode 100644 mlt/src/humperdink/client.c delete mode 100644 mlt/src/humperdink/client.h delete mode 100644 mlt/src/humperdink/io.c delete mode 100644 mlt/src/humperdink/io.h delete mode 100644 mlt/src/humperdink/remote.c delete mode 100644 mlt/src/inigo/Makefile delete mode 100755 mlt/src/inigo/configure delete mode 100644 mlt/src/inigo/inigo.c delete mode 100644 mlt/src/inigo/io.c delete mode 100644 mlt/src/inigo/io.h delete mode 100644 mlt/src/miracle/Makefile delete mode 100755 mlt/src/miracle/configure delete mode 100644 mlt/src/miracle/miracle.c delete mode 100644 mlt/src/miracle/miracle_commands.c delete mode 100644 mlt/src/miracle/miracle_commands.h delete mode 100644 mlt/src/miracle/miracle_connection.c delete mode 100644 mlt/src/miracle/miracle_connection.h delete mode 100644 mlt/src/miracle/miracle_local.c delete mode 100644 mlt/src/miracle/miracle_local.h delete mode 100644 mlt/src/miracle/miracle_log.c delete mode 100644 mlt/src/miracle/miracle_log.h delete mode 100644 mlt/src/miracle/miracle_server.c delete mode 100644 mlt/src/miracle/miracle_server.h delete mode 100644 mlt/src/miracle/miracle_unit.c delete mode 100644 mlt/src/miracle/miracle_unit.h delete mode 100644 mlt/src/miracle/miracle_unit_commands.c delete mode 100644 mlt/src/miracle/miracle_unit_commands.h delete mode 100644 mlt/src/modules/Makefile delete mode 100755 mlt/src/modules/configure delete mode 100644 mlt/src/modules/core/Makefile delete mode 100755 mlt/src/modules/core/configure delete mode 100644 mlt/src/modules/core/factory.c delete mode 100644 mlt/src/modules/core/filter_deinterlace.c delete mode 100644 mlt/src/modules/core/filter_deinterlace.h delete mode 100644 mlt/src/modules/core/filter_gamma.c delete mode 100644 mlt/src/modules/core/filter_gamma.h delete mode 100644 mlt/src/modules/core/filter_greyscale.c delete mode 100644 mlt/src/modules/core/filter_greyscale.h delete mode 100644 mlt/src/modules/core/filter_resize.c delete mode 100644 mlt/src/modules/core/filter_resize.h delete mode 100644 mlt/src/modules/core/filter_volume.c delete mode 100644 mlt/src/modules/core/filter_volume.h delete mode 100644 mlt/src/modules/core/producer_ppm.c delete mode 100644 mlt/src/modules/core/producer_ppm.h delete mode 100644 mlt/src/modules/core/transition_composite.c delete mode 100644 mlt/src/modules/core/transition_composite.h delete mode 100644 mlt/src/modules/core/transition_luma.c delete mode 100644 mlt/src/modules/core/transition_luma.h delete mode 100644 mlt/src/modules/core/transition_mix.c delete mode 100644 mlt/src/modules/core/transition_mix.h delete mode 100644 mlt/src/modules/dv/Makefile delete mode 100755 mlt/src/modules/dv/configure delete mode 100644 mlt/src/modules/dv/consumer_libdv.c delete mode 100644 mlt/src/modules/dv/consumer_libdv.h delete mode 100644 mlt/src/modules/dv/factory.c delete mode 100644 mlt/src/modules/dv/producer_libdv.c delete mode 100644 mlt/src/modules/dv/producer_libdv.h delete mode 100644 mlt/src/modules/ffmpeg/Makefile delete mode 100755 mlt/src/modules/ffmpeg/audio.sh delete mode 100755 mlt/src/modules/ffmpeg/configure delete mode 100644 mlt/src/modules/ffmpeg/consumer_ffmpeg.c delete mode 100644 mlt/src/modules/ffmpeg/consumer_ffmpeg.h delete mode 100644 mlt/src/modules/ffmpeg/factory.c delete mode 100644 mlt/src/modules/ffmpeg/filter_ffmpeg_dub.c delete mode 100644 mlt/src/modules/ffmpeg/filter_ffmpeg_dub.h delete mode 100644 mlt/src/modules/ffmpeg/producer_ffmpeg.c delete mode 100644 mlt/src/modules/ffmpeg/producer_ffmpeg.h delete mode 100755 mlt/src/modules/ffmpeg/video.sh delete mode 100644 mlt/src/modules/gtk2/Makefile delete mode 100755 mlt/src/modules/gtk2/configure delete mode 100644 mlt/src/modules/gtk2/factory.c delete mode 100644 mlt/src/modules/gtk2/producer_pango.c delete mode 100644 mlt/src/modules/gtk2/producer_pango.h delete mode 100644 mlt/src/modules/gtk2/producer_pixbuf.c delete mode 100644 mlt/src/modules/gtk2/producer_pixbuf.h delete mode 100644 mlt/src/modules/inigo/Makefile delete mode 100755 mlt/src/modules/inigo/configure delete mode 100644 mlt/src/modules/inigo/factory.c delete mode 100644 mlt/src/modules/inigo/producer_inigo.c delete mode 100644 mlt/src/modules/inigo/producer_inigo.h delete mode 100644 mlt/src/modules/resample/Makefile delete mode 100755 mlt/src/modules/resample/configure delete mode 100644 mlt/src/modules/resample/factory.c delete mode 100644 mlt/src/modules/resample/filter_resample.c delete mode 100644 mlt/src/modules/resample/filter_resample.h delete mode 100644 mlt/src/modules/sdl/Makefile delete mode 100755 mlt/src/modules/sdl/configure delete mode 100644 mlt/src/modules/sdl/consumer_sdl.c delete mode 100644 mlt/src/modules/sdl/consumer_sdl.h delete mode 100644 mlt/src/modules/sdl/factory.c delete mode 100644 mlt/src/modules/westley/Makefile delete mode 100755 mlt/src/modules/westley/configure delete mode 100644 mlt/src/modules/westley/consumer_westley.c delete mode 100644 mlt/src/modules/westley/consumer_westley.h delete mode 100644 mlt/src/modules/westley/factory.c delete mode 100644 mlt/src/modules/westley/producer_westley.c delete mode 100644 mlt/src/modules/westley/producer_westley.h delete mode 100644 mlt/src/tests/Makefile delete mode 100644 mlt/src/tests/charlie.c delete mode 100644 mlt/src/tests/clock16ntsc.pgm delete mode 100644 mlt/src/tests/clock16pal.pgm delete mode 100644 mlt/src/tests/dan.c delete mode 100644 mlt/src/tests/dissolve.c delete mode 100644 mlt/src/tests/io.c delete mode 100644 mlt/src/tests/io.h delete mode 100644 mlt/src/tests/luma.c delete mode 100644 mlt/src/tests/pango.c delete mode 100644 mlt/src/tests/pixbuf.c delete mode 100644 mlt/src/tests/setenv delete mode 100644 mlt/src/tests/test.png delete mode 100644 mlt/src/valerie/Makefile delete mode 100755 mlt/src/valerie/configure delete mode 100644 mlt/src/valerie/valerie.c delete mode 100644 mlt/src/valerie/valerie.h delete mode 100644 mlt/src/valerie/valerie_notifier.c delete mode 100644 mlt/src/valerie/valerie_notifier.h delete mode 100644 mlt/src/valerie/valerie_parser.c delete mode 100644 mlt/src/valerie/valerie_parser.h delete mode 100644 mlt/src/valerie/valerie_remote.c delete mode 100644 mlt/src/valerie/valerie_remote.h delete mode 100644 mlt/src/valerie/valerie_response.c delete mode 100644 mlt/src/valerie/valerie_response.h delete mode 100644 mlt/src/valerie/valerie_socket.c delete mode 100644 mlt/src/valerie/valerie_socket.h delete mode 100644 mlt/src/valerie/valerie_status.c delete mode 100644 mlt/src/valerie/valerie_status.h delete mode 100644 mlt/src/valerie/valerie_tokeniser.c delete mode 100644 mlt/src/valerie/valerie_tokeniser.h delete mode 100644 mlt/src/valerie/valerie_util.c delete mode 100644 mlt/src/valerie/valerie_util.h diff --git a/mlt/ChangeLog b/mlt/ChangeLog deleted file mode 100644 index e69de29..0000000 diff --git a/mlt/Makefile b/mlt/Makefile deleted file mode 100644 index 36c1f12..0000000 --- a/mlt/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -SUBDIRS = src/framework \ - src/modules \ - src/inigo \ - src/valerie \ - src/miracle \ - src/humperdink \ - src/albino - -all clean dist-clean depend install: - list='$(SUBDIRS)'; \ - for subdir in $$list; do \ - $(MAKE) -C $$subdir $@; \ - done - diff --git a/mlt/README b/mlt/README deleted file mode 100644 index 902bb32..0000000 --- a/mlt/README +++ /dev/null @@ -1,135 +0,0 @@ -README ------- - - This document provides a description of the MLT project organisation. - - It provides *CRITICAL* architecture information, so please read carefully - if you plan to extend or use the MLT code base. - -Directories ------------ - - The directory heirarchy is defined as follows: - - + docs - Location of all text and source format - documentation - + src - All project source is provided here - + framework - The media framework - + modules - All components are defined here - + core - Non-dependent MLT service - + dv - libdv services - + ffmpeg - ffmpeg dependent modules and test code - + sdl - SDL dependent modules and test code - + bluefish - Bluefish dependent modules and test code (*) - + mainconcept - mainconcept dependent modules and test code (*) - + inigo - A media playing test application - + valerie - Client API to access the server - + miracle - The server implementation - + humperdink - The evil demo - + albino - The simple but nice demo - + tests - Reserved for regression and unit tests - - Additional subdirectories may be nested below those shown and should be - documented in their parent. - - (*) Not posted to CVS due to licensing issues. - -Configuration -------------- - - Configuration is triggered from the top level directory via a - ./configure script. - - Each source bearing subdirectory shown above have their own configure - script which are called automatically from the top level. - - Typically, new modules can be introduced without modification to the - configure script and arguments are accepted and passed through to all - subdirectories. - - Top level usage is: - - ./configure --help - report all configure options - ./configure --prefix=[dir] - target install directory (default: /usr/local) - ./configure --disable-[mod] - do not compile specified module(s) - ./configure --[other] - pass through to children - - NB: This script must be run to register new services after a CVS checkout - or subsequent update. - -Compilation ------------ - - Makefiles are generated during configuration and these are based on - a per directory template which must be provided by the developer. - -Testing -------- - - To execute the mlt tools without installation, or to test a new version - on a system with an already installed mlt version, you should run: - - . setenv - - NB: This applies to your current shell only. - -Installation ------------- - - * NOT IMPLEMENTED YET * - - The install is triggered by running make install or make install-strip - from the top level directory. - - The framework produces a single shared object which is installed in - $prefix/lib/ and public header files which are installed in - $prefix/include/mlt/framework. - - The client produces a single shared object which is installed in - $prefix/lib/ and public header which are installed in - $prefix/include/mlt/client. - - The server produces a single exectuable which is installed in - $prefix/bin/. This is linked against the framework shared object and - posix libs but not against any of the modules. - - The modules produce a shared object per module and update text files - containing a list of modules provided by this build. These are installed - in $prefix/share/mlt/. It is at the discretion of the module to install - additional support files. - - To allow the development of external components, mlt-client-config and - mlt-framework-config scripts are generated and installed in $prefix/bin. - - After install, only those modules listed are usable by the server. No - module is loaded unless explicitly requested via server configuration - or usage. - - External modules are also placed in this $prefix/share/mlt, and the - installation of those must modify the text file accordingly before they - will be considered at runtime. - -Development ------------ - - All compilation in the project has {top-level-dir}/src on the include path. - All headers are included as: - - #include - - All external modules have {prefix}/include/mlt on the include path. All - headers should also be included as: - - #include - - This allows migration of source between external and internal modules. - The configuration and Makefile template requirements will require - attention though. - -Summary -------- - - 1. The server will interact with public interfaces from the framework only; - 2. The modules must expose public framework interfaces only; - 3. All modules are dynamically loaded at runtime. - diff --git a/mlt/configure b/mlt/configure deleted file mode 100755 index 4b39bfc..0000000 --- a/mlt/configure +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -function show_help -{ - cat << EOF -Funky non-autotool config script for MLT. - - Options are: - - --help - this information - --prefix=directory - install prefix for path (default: $prefix) -EOF - - for i in src/modules/* - do - [ -d $i ] && echo " --disable-`basename $i`" - done - - echo -} - -# Debug mode -set +x - -# Define build directory for scripts called -export build_dir=`dirname $0` -export prefix=/usr/local -export help=0 - -# Iterate through arguments -for i in $* -do - case $i in - --help ) help=1 ;; - --prefix=* ) prefix="${i#--prefix=}" ;; - esac -done - -# Show help if requested -[ $help = 1 ] && show_help - -# Iterate through each of the components -for i in framework modules inigo valerie miracle humperdink -do - if [ -x src/$i/configure ] - then - echo "Configuring `basename $i`:" - pushd src/$i > /dev/null - ./configure $@ - [ $? != 0 ] && exit 1 - popd > /dev/null - fi -done - diff --git a/mlt/docs/dvcp.txt b/mlt/docs/dvcp.txt deleted file mode 100644 index 6da16db..0000000 --- a/mlt/docs/dvcp.txt +++ /dev/null @@ -1,336 +0,0 @@ - -dv1394d Control Protocol (DVCP) Reference Documentation - -Copyright (C) 2003 Ushodaya Enterprised Limited -Author: Dan Dennedy -Last Revision: 2003-01-13 - -General Format --------------- - DVCP is an ASCII-based request/response TCP protocol much like FTP and - inspired by the SGI MVCP (Multiport Video Computer Protocol). Each - command is three to eight characters long followed by zero or more - arguments. Every item (command or argument) in the request is delimited - by a space and terminated with a new line. Arguments that contain spaces - must be surrounded by double quotation marks. The new line must contain - a line feed optionally preceeded by a carriage return. There are no - request header lines or body. - - -Response Codes --------------- - Responses consist of a numeric result code followed by a space folowed - by a brief textual description of the result. No quoting is applied to - descriptions regardless if it contains spaces. The result codes are - grouped by the hundreds into general categories of responses. Anything - in the 200-299 range is considered a success and anything 300 and above - is an error or exception. Most responses do not contain a body except - some of the success results that report information and sometimes the - 500 Server Error returns specific information. - A 200 result code contains no body. - A 201 result code contains one or more lines in the body, and a empty - line terminates the response. - A 202 result code contains only a single response line in the body. - - Errors in the 400 range indicate a normally handled error where the - command could not perform its action due to protocol syntax errors or - problems with validation of one or more of the arguments. This usually - indicates that the client is responsible for performing an illegal - request. - - Errors in the 500 range indicate a server error or exception. - - The following is a list of response codes and their descriptions: - 200 OK - 201 OK - 202 OK - 400 Unknown command - 401 Operation timed out - 402 Argument missing - 403 Unit not found - 404 Failed to locate or open clip - 405 Argument value out of range - 500 Server Error - - -Establishing a Connection -------------------------- - One can connect to the miracle server using telnet or a custom client, - preferrably one developed using the valerie client API. The default port - is 5250. Connections can be broken at will or use the BYE command to - request the server to terminate the connection. - - -General Command Information ---------------------------- - - All commands are case insensitive. Arguments may or may not be case - sensitive. There are two categories of commands: global and unit. Global - commands operate at the server level. Unit commands address a specific - unit. miracle is a multi-unit system. Units are named as U? where ? - is the unit number, for example, U0. As units are added to the server, - the unit number increases; the first unit is U0. - - The command HELP lists all commands known to the server with a brief - description of their purpose and arguments. Most commands take zero or - one argument outside of the unit name. Sometimes an argument is - optional, and an optional argument always follows required arguments. - All units command required a unit name argument. - - {} = required argument - [] = optional argument - () = one of a set of pre-defined values - - -Global Commands ---------------- - -HELP - List the commands and their brief description. - -BYE - Close the connection. - -SHUTDOWN - Shutdown the server and all client connections. - -SET {key=value} - Set a global server configuration property. - Currently, the only planned key is "root" to set the base directory - path for the CLS and LOAD commands. The default root value is /. - -GET {key} - Get the current value of a configuration property. - The value is returned by itself in the body of the response. - -CLS {path} - List the clips and subdirectories at {path} on the server. - Only subdirectories, non-hidden regular files, symbolic links, and NFS - shares are supported. - The response body contains one line per item. - The name of the subdirectory/file is always surrounded by double - quotation marks in case it contains spaces. - Subdirectories are listed before files and have a trailing / in their - name. - File entries have a size value in bytes in the second column position. - -RUN {file} - Process the commands in a file located on the server. - Commands are executed one after the other with no delay until the end - of file is reached or a command returns a response code not in the 200 - range. - The response body contains each command sent along with its arguments, - followed by each command's response status code and response body. - - -STATUS - Responds with the output of USTA for each unit and accepts no further - input. Each time the state of the unit changes, a new row is returned by - the server containing the state of the unit. - -Unit Management - - The following global commands manage the DV units within the server. - Currently there is a maximum of four units, and units can not be - removed. Each unit may be in an online or offline state. Offline units - can not be used, and any unit commands issued against an offline unit - results in a 403 response. - -NLS - * NOT IMPLEMENTED IN MIRACLE YET * - - -UADD mlt-consumer[:argument] - Add a unit based upon the mlt-consumer id and optional constructor - argument. - If the consumer is not found, then it still added but in an - offline manner. Later, by adding the device to the bus, the unit will - automatically become online. - The response body contains the name of the new unit: U0, U1, U2, or U3. - Channel is an optional setting. - -ULS - List the units. - The response body contains a space-delimited row for each unit in the - server containing the following columns: - - unit name (one of U0, U1, U2, or U3) - - mlt-consumer[:argument] from uadd - - 1394 node GUID (defunt - always 0 with miracle for now) - - online flag (1 = online, 0 = offline) - -SHUTDOWN - Shutdown the server. - - -Unit Commands -------------- - - The first argument of any unit command is the unit name (U0 - U3). A - unit must be loaded with a file before it can play anything. A "clip" - refers to the presence of a file loaded into the unit. A clip can - contain an in and out point to set the playback region. The default in - point is 0, and the default out point is the number of frames in the - file minus one. Therefore, all frame positions are zero-based. - -USET {unit} {key=value} - Set a unit's configuration property. - Key is one of the following: eof, points. - - Property "eof" determines what the playback engine does when it reaches - the end of a clip. The eof property takes one of the following values: - stop, loop, continue or pause. The default is pause. - - Property "points" determines whether the playback engine restricts the - playback region to the in and out points. It takes one of the following - values: use, ignore. - -UGET {unit} {key} - Get a unit's configuration property. - Key is one of the following: eof, points. - The response body contains only the key's value. See USET for information - about each property. - -LIST {unit} - List the clips associated to the unit. - The response body consists of two sections - the first section is a single row - containing the generation number of the playlist associated to the unit (an - integer starting from 0 which is incremented on each action which changes the - playlist). The second sections contais a space-delimited row for each clip in the - units playlistcontaining the following columns: - - clip index (starts from 0) - - file name - - in point - - out point - - real length of the files - - calculated length of file - When USET points=use is specified (default), the calculated size is (out-in)+1. - When points are ignored, the real length of the file is returned. - -LOAD {unit} {filename} [in out] - Load a clip into the unit. - Optionally set the in and out points to the specified absolute frame numbers. - Sets the current position to the first frame in the clip. - Preface the filename with '!' to tell the disk reader thread to remove only - duplicate frames from the tail of its buffer queue (from a previously loaded - and playing clip). Otherwise, miracle flushes all of its buffers upon LOAD - to make the effect of LOAD instantaneous. The LOAD !, USET eof=pause, and - extended USTA information can be used for client-side playlists (see the - demo programs). - -APND {unit} {filename} [in out] - Append a clip onto the unit's playlist. - Optionally set the in and out points to the specified absolute frame numbers. - -INSERT {unit} {filename} [ [+|-]clip [ in out ] ] - Insert a clip into the units playlist at the specified clip index or relative - to the currently playing clip index. - -REMOVE {unit} [ [+|-]clip ] - Removes a clip from the specified clip index or position relative to the - currently playing clip index. - -CLEAN {unit} - Removes all by the playing clip. - -MOVE {unit} [+|-]clip [ [+|-]clip ] - Move a clip in the playlist to position specified or position relative to the - currently playing clip. - -PLAY {unit} [speed] - Commence unit playback from the current position. - The default speed is 100% if not specified. - Speed is represented as a percentage value multiplied by 10. Therefore - the default playback speed is 1000 (1X or 100%), 2X is 2000. - Negative speed values play in reverse. - -STOP {unit} - Terminate the unit playback resulting in no video being sent. - -PAUSE {unit} - Pause the unit playback causing the current frame position to he held - indefinitely. - -REW {unit} - Rewind the unit. - If the unit it playing, then REW sets the playback speed to 2000 - (200%). - If the unit is stopped, then the frame position is reset to the first - frame. First frame depends upon the "points" unit configuration property - and whether an in point has been established for the clip using the SIN - command. - Set the currently loaded clip's in point. - Frame is zero-based and absolute. It is not dependent upon the clip's - current in point. - A frame-number of -1, resets the in point to 0. - -FF {unit} - Fast forward the unit. - If the unit it playing, then FF sets the playback speed to -2000 (200% - in reverse). - If the unit is stopped, then the frame position is reset to the first - frame. First frame depends upon the "points" unit configuration property - and whether an in point has been established for the clip using the SIN - command. - -STEP {unit} {number-of-frames} - Adjust the current frame position by the number of frames specified. - Number-of-frames can accept positive or negative values. - -GOTO {unit} {frame-number} [ [+|-]clip ] - Set the current frame position to frame-number. - Frame-number is zero-based and absolute within the clip, which means it is - relative to the file beginning and not the clip in point. - It does not alter the playback status of the unit. - -SIN {unit} {frame-number} [ [+|-]clip ] - Set the currently loaded clip's in point. - The in point is the logical starting frame of the clip. - Frame is zero-based and absolute. It is not dependent upon the clip's - current in point. - A frame-number of -1, resets the in point to 0. - -SOUT {unit} {frame-number} [ [+|-]clip ] - Set the currently loaded clip's out point. - The out point is the logical last frame of the clip. - Frame is zero-based and absolute. It is not dependent upon the clip's - current out point. - A frame-number of -1, resets the out point to the number of frames in - the file minus 1. - -USTA {unit} - Get the unit status report. - The response body contains the following fields delimited by spaces: - - unit number: U0, U1, U2, or U3 without the "U" prefix - - mode: (offline|not_loaded|playing|stopped|paused|disconnected|unknown) - "unknown" means the unit has not been added - "disconnected" means the server has closed a connection to a client running - STATUS. - - current clip name: filename - - current position: in absolute frame number units - - speed: playback rate in (percent * 10) - - fps: frames-per-second of loaded clip - - current in-point: starting frame number - - current out-point: ending frame number - - length of the clip - - buffer tail clip name: filename - - buffer tail position: in absolute frame number units - - buffer tail in-point: starting frame number - - buffer tail out-point: ending frame number - - buffer tail length: length of clip in buffer tail - - seekable flag: indicates if the current clip is seekable (relates to head) - - playlist generation number - - current clip index (relates to head) - - The status contains information based not only on the current frame being - output (current above) but also based upon the most recent frame read by - the disk reader thread and added to the tail of the input buffer queue - (buffer tail above). - -XFER {unit} {target-unit} - Transfer the unit's clip to the target unit. - The clip inherently includes the in- and out-point information. - The target unit's "points" configuration property is set to "use." - - - - diff --git a/mlt/docs/inigo.txt b/mlt/docs/inigo.txt deleted file mode 100644 index 9fa53e1..0000000 --- a/mlt/docs/inigo.txt +++ /dev/null @@ -1,286 +0,0 @@ -INIGO ------ - -Preamble: - - inigo was developed as a test tool for the MLT framework. It can - be thought of as a powerful, if somewhat obscure, multitrack - command line oriented video editor. - - The following details the usage of the tool and as a result, - provides a lot of insight into the workings of the MLT framework. - - -Usage: - - inigo [ -group [ name=value ]* ] - [ -consumer id[:arg] [ name=value ]* ] - [ -filter id[:arg] [ name=value ] * ] - [ -transition id[:arg] [ name=value ] * ] - [ -blank frames ] - [ -track ] - [ producer [ name=value ] * ]+ - [ -serialise file.inigo ] - - -General rules: - - 1. Order is incredibly important; - - 2. Error checking on command line parsing is weak; - - 3. Please refer to services.txt for details on services - available; - - 4. The MLT framework, from which inigo has inherited its - naming convention - is very ego-centric. Producers produce - MLT frame objects and consumers consume MLT frame objects. - The distinction is important - a DV producer does not produce - DV and a DV consumer does not consume DV. - - -Terminoligy: - - 'Producers' typically refer to files but may also indicate - devices (such as dv1394 input or video4linux). Hence, the more - generic term is used [yes, the more generic usage is out of - scope for now...]. - - 'Filters' are frame modifiers - they always guarantee that for - every frame they receive, they output *precisely* one frame. - Never more, never less, ever. - - 'Transitions' collect frames from two tracks (a and b) and - output 1 modified frame on their 'a track', and 1 unmodified - frame on their 'b track'. Never more, never less, ever. - - 'Consumers' collect frames from a producer, do something with - them and destroy them. - - Collectively, these are known as 'services'. - - All services have 'properties' associated to them. These are - typically defaulted or evaluated and may be overriden on a case - by case basis. - - All services except consumers obey in and out properties. - - Consumers have no say in the flow of frames [though they may - give the illusion that they do]. They get frames from a - connected producer, use them, destroy them and get more. - - -Basics: - - To play a file with the default SDL PAL consumer, usage is: - - $ inigo file - - Note that 'file' can be anything that inigo has a known - 'producer' mapping for (so this can be anything from .dv to - .txt). - - -Properties: - - Properties can be assigned to the producer by adding additional - name=value pairs after the producer: - - $ inigo file in=50 out=100 something="something else" - - Note that while some properties have meaning to all producers - (for example: in, out and length are guaranteed to be valid for - all, though typically, length is determined automatically), the - validity of others are dependent on the producer - however, - properties will always be assigned, but it doesn't mean they - will be used. - - -Multiple Files: - - Multiple files of different types can be used: - - $ inigo a.dv b.mpg c.png - - Properties can be assigned to each file: - - $ inigo a.dv in=50 out=100 b.mpg out=500 c.png out=500 - - -Filters: - - The Multiple Files examples above will logically playout one - after the other. - - However, inigo doesn't care too much about changes in frame - dimensions or audio specification, so you may need to add - additional normalising filters to that, ie: - - $ inigo a.dv b.mpg c.png -filter resize -filter resample - - These filters are designed to guarantee that the consumer gets - what it asks for. - - It should also be stressed that filters are applied in the order - in which they're specified. - - -Filter Properties: - - As with producers, properties may be specified on filters too. - - Again, in and out properties are common to all, so to apply a - filter to a range of frames, you would use something like: - - $ inigo a.dv -filter greyscale in=0 out=50 - - Again, filters have their own set of rules about properties and - will silently ignore properties that do not apply. - - -Groups: - - The -group switch is provided to force default properties on the - following 'services'. For example: - - $ inigo -group in=0 out=49 clip* - - would play the first 50 frames of all clips that match the wild - card pattern. - - Note that the last -group settings also apply to the following - filters, transitions and consumers, so: - - $ inigo -group in=0 out=49 clip* -filter greyscale - - is *probably not* what you want (ie: the greyscale filter would - only be applied to the first 50 frames). - - To shed the group properties, you can use any empty group: - - $ inigo -group in=0 out=49 clip* -group -filter greyscale - - -Introducing Tracks and Blanks: - - So far, all of the examples have shown the definition of a - single playlist, or more accurately, track. - - When multiple tracks exist, the consumer will receive a frame - from the 'lowest numbered' track that is generating a non-blank - frame. - - It is best to visualise a track arrangement, so we'll start with - an example: - - $ inigo a.dv out=49 -track b.dv - - This can be visualised as follows: - - +-------+ - |a | - +-------+----------+ - |b | - +------------------+ - - Playout will show the first 50 frames of a and the 51st frame - shown will be the 51st frame of b. - - To have the 51st frame be the first frame of b, we can use the - -blank switch: - - $ inigo a.dv out=49 -track -blank 49 b.dv - - Which we can visualise as: - - +-------+ - |a | - +-------+-------------------+ - |b | - +-------------------+ - - Now playout will continue as though a and b clips are on the - same track (which is about as useful as reversing the process of - slicing bread). - - -Transitions: - - Where tracks become useful is in the placing of transitions. - - Here we need tracks to overlap, so a useful multitrack - definition could be given as: - - $ inigo a.dv out=49 -transition luma in=25 out=49 \ - -track \ - -blank 24 b.dv - - Now we're cooking - our visualisation would be something like: - - +-------+ - |a | - +---+---+--------------+ - |b | - +------------------+ - - Playout will now show the first 25 frames of a and then a fade - transition for 25 frames between a and b, and will finally - playout the remainder of b. - - -Reversing a Transition: - - When we visualise a track definition, we also see situtations - like: - - +-------+ +----------+ - |a1 | |a2 | - +---+---+--------------+----+-----+ - |b | - +-----------------------+ - - In this case, we have two transitions, a1 to b and b to a2. - - In this scenario, we define a command line as follows: - - $ inigo a.dv out=49 -blank 49 a2.dv \ - -transition luma in=25 out=49 \ - -transition luma in=100 out=124 reverse=1 \ - -track \ - -blank 24 b.dv out=99 - - -Filters and Tracks: - - A filter applies to a [specified region of a] single track, so - normalisation filters need to be applied to each track when - applicable. - - This user specification is a necessary evil (you do not want to - resize a text or png overlay to be the size of the frame that - the consumer is requesting, and you may not want to unecessarily - resize a video track if you will be later rescaling it for - composition). - - -Serialisation: - - Inigo has a built in serialisation mechanism - you can build up - your command, test it via any consumer and then add a -serialise - file.inigo switch to save it. - - The saved file can be subsequently used as a clip by either - miracle or inigo. Take care though - paths to files are saved as - provided on the command line.... - - -Missing Features: - - Some filters/transitions should be applied on the output frame - regardless of which track it comes from - for example, you might - have a 3rd text track or a watermark which you want composited - on every frame, and of course, there's the obscure feature.... - - A -post switch will be added to provided this feature at some - point soon. - diff --git a/mlt/docs/services.txt b/mlt/docs/services.txt deleted file mode 100644 index 50f3cad..0000000 --- a/mlt/docs/services.txt +++ /dev/null @@ -1,664 +0,0 @@ -Producers ---------- - - ffmpeg - - Description - - Test case pipe based producer for video and audio. - - Constructor Argument - - 'file' - produce a/v from file - v4l - produce a/v from video4linux and dsp device - - Initialisation Properties - - string video_type - "file" or "v4l" - string video_file - file or v4l device - string video_size - WxH of video to produce (default: "") - int video_loop - loop video until audio exhausted (default: 0) - string audio_type - "file" or "dsp" - string audio_file - file or dsp device - int audio_rate - audio frequency (default: 48000) - int audio_channels - audio channels (default: 2) - int audio_track - audio track to use (default: 0) - int audio_loop - loop audio until video exhausted (default: 0) - intint in - in point - int out - out point - double fps - output frames per second (default: 25) - double aspect_ratio - aspect ratio of video - - Read Only Properties - - string resource - file or "v4l" - int end_of_clip - holds 1 when input is exhausted - - Dependencies - - ffmpeg executable. - - Known Bugs - - in point setting is broken. - - Implementation does not allow fast random access. - - libdv - - Description - - libdv based decoder for video and audio. - - Constructor Argument - - 'file' - produce a/v from file - - Initialisation Properties - - int in - in point - int out - out point - - Read Only Properties - - string resource - file location - double fps - output frames per second - double aspect_ratio - aspect ratio of video] - int length - duration of resource (in frames) - - Dependencies - - libdv. - - Known Bugs - - None. - - mcdv - - Description - - Mainconcept based dv decoder for video and audio. - - Constructor Argument - - 'file' - produce a/v from file - - Initialisation Properties - - int in - in point - int out - out point - - Read Only Properties - - string resource - file location - double fps - output frames per second - double aspect_ratio - aspect ratio of video - int length - duration of resource (in frames) - - Dependencies - - mainconcept dv sdk and libdv. - "dv_sdk" installed parallel to mlt. - - Known Bugs - - Can be problematic with source NTSC DV files? really? yes - try - playing pond.dv... - - mcmpeg - - Description - - Mainconcept based mpeg decoder for video and audio. - - Constructor Argument - - 'file' - produce a/v from file - - Initialisation Properties - - int in - in point - int out - out point - - Read Only Properties - - string resource - file location - double fps - output frames per second - double aspect_ratio - aspect ratio of video - - Dependencies - - mainconcept mpeg sdk. - "mpeg_sdk_demo" installed parallel to mlt. - - Known Bugs - - None. - - pango - - Description - - A title generator that uses the Pango international text layout - and Freetype2 font renderer. - - Constructor Argument - - string file - a text file containing Pango markup, see: - http://developer.gnome.org/doc/API/2.0/pango/PangoMarkupFormat.html - - requires xml-like encoding special chars: <, >, & to <, >, & - - Initialisation Properties - - int in - in point - int out - out point - - Mutable Properties - - int video_standard - enum mlt_video_standard from mlt_frame.h - PAL = 0, NTSC = 1 - this determines proper pixel aspect ratio - - string markup - a string containing Pango markup see: - http://developer.gnome.org/doc/API/2.0/pango/PangoMarkupFormat.html - - requires xml-like encoding special chars: <, >, & to <, >, & - - int fgcolor - an rgba color specification of the text (i.e. 0xrrggbbaa) - int bgcolor - an rgba color of the background rectangle - int align - paragraph alignment: 0 = left, 1 = center, 2 = right - int pad - the number of pixels to pad the background rectangle beyond edges of text - default 0 - string markup - see constructor argument - string text - non-markup text (can contain markup chars un-encoded) - string font - the default typeface to use when not using markup - default "Sans 48" - int x - the horizontal position of the title on the frame - default 0 - int y - the vertical position of the title on the frame - default 0 - double mix - the overall opacity control of the generated title - default 1.0 - - Read Only Properties - - string resource - the text/markup file or "pango" if no file - - Dependencies - - libpango-1.0, libpangoft2-1.0, libfreetype, libgdk_pixbuf-2.0, libglib-2.0, - libgobject-2.0, libgmodule-2.0, libfontconfig - - Known Bugs - - no frame-alignment functionality - - pixbuf - - Description - - A graphics overlay generator using gdk-pixbuf - - Constructor Argument - - 'file' - The name of a graphics file loadable by - a gdk-pixbuf loader. see /usr/lib/gdk-pixbuf/loaders - definitely png, jpeg, tiff, pnm, and xpm - - If "%" in filename, the filename is used with sprintf - generate a filename from a counter for multi-file/flipbook animation. - The file sequence ends when numeric discontinuity >100. - - If filename contains "/.all.", suffix with an extension to load - all pictures with matching extension from a directory - - Initialisation Properties - - int in - in point - int out - out point - - Mutable Properties - - int video_standard - enum mlt_video_standard from mlt_frame.h - PAL = 0, NTSC = 1 - this determines proper pixel aspect ratio - double ttl - how long (seconds) to repeat each picture in file sequences - int x - the horizontal offset from the left edge of the frame - int y - the vertical offset from the top edge of the frame - double mix - the opacity factor to apply to the second frame - (used in addition to alpha channel). - - - Read Only Properties - - string resource - file location - - Dependencies - - libgdk_pixbuf-2.0, libglib-2.0, libgobject-2.0, libgmodule-2.0 - - Known Bugs - - in/out settings are incorrectly handled. - - ppm - - Description - - Reads a stream of contiguous PPM images. - - Constructor Argument - - command - a shell command to run something that produces ppm - streams on stdout. - - Initialisation Properties - - none - - Read Only Properties - - string resource - the command - - Dependencies - - none - - Known Bugs - - Since it uses pipes, it is not compatible with bluefish. - - -Filters -------- - - deinterlace - - Description - - Deinterlace a frame consisting of two fields by linearly blending. - - Constructor Argument - - none - - Initialisation Properties - - int in - in point - int out - out point - - Read Only Properties - - none - - Dependencies - - none - - Known Bugs - - Not a bug, but it only provides fair quality at a fair performance; - i.e., it excels at neither. - - ffmpeg_dub - - Description - - Use ffmpeg executable to substitute audio stream. - - Constructor Argument - - file - filename of a WAV, Ogg Vorbis (--enable-vorbis), - MP3 (--enable-mp3lame), or AC-3 (--enable-a52) audio file. - - Initialisation Properties - - int in - in point - int out - out point - - Read Only Properties - - string resource - file - - Dependencies - - ffmpeg plus for ffmpeg: - libogg and libvorbis for Ogg Vorbis, libmp3lame for MP3, liba52 for AC-3. - - Known Bugs - - Uses pipes and is therefore not compatible with bluefish. - - gamma - - Description - - Adjust image luma using a non-linear power-law curve - - Constructor Argument - - gamma - a floating point value - - Initialisation Properties - - int in - in point - int out - out point - - Mutable Properties - - double gamma - the exponential factor of the power-law curve - - Dependencies - - none - - Known Bugs - - none - - greyscale - - Description - - Convert color image to greyscale - - Constructor Argument - - none - - Initialisation Properties - - int in - in point - int out - out point - - Read Only Properties - - none - - Dependencies - - none - - Known Bugs - - none - - resize - - Description - - Image scaling and padding - - Constructor Argument - - scale - "affine" to use affine transform scaling, otherwise - center and pad. - - Initialisation Properties - - int in - in point - int out - out point - - Read Only Properties - - none - - Dependencies - - none - - Known Bugs - - none - - volume - - Description - - Adjust an audio stream's volume level - - Constructor Argument - - volume - a floating point value of the factor - - Initialisation Properties - - int in - in point - int out - out point - - Mutable Properties - - double volume - the factor applied to each sample - - Dependencies - - none - - Known Bugs - - none - - resample - - Description - - Adjust an audio stream's sampling rate - - Constructor Argument - - frequency - a numeric value for the new sample rate - - Initialisation Properties - - int in - in point - int out - out point - - Mutable Properties - - int frequency - the target sample rate - - Dependencies - - libresample - - Known Bugs - - none - -Transitions ------------ - - composite - - Description - - An alpha-channel based compositor for two frames. - - Constructor Argument - - mix - see below - - Initialisation Properties - - int in - in point - int out - out point - - Mutable Properties - - int x - the horizontal offset from the left edge of the frame - int y - the vertical offset from the top edge of the frame - double mix - the opacity factor to apply to the second frame - (used in addition to alpha channel). - - any negative value causes an automatic dissolve - - Read Only Properties - - none - - Dependencies - - none - - Known Bugs - - Need to add field-based rendering. - - luma - - Description - - A generic dissolve and wipe transition processor. It gets its name - from how it uses a grayscale "map" file. As the luma value varies - over time, a threshold filter is applied to the map to determine - what parts of frame A vs. frame B to show. It only reads PGM - files, but it does handle 16 bit PGM. This performs field-based - rendering. - - Constructor Argument - - string file - the luma map file name. If not supplied, a dissolve. - - Initialisation Properties - - int in - in point - int out - out point - - Mutable Properties - - string filename - same as above - double softness - only when using a luma map, how soft to make the - edges between A and B. 0.0 = no softness. 1.0 = - too soft. - - Read Only Properties - - none - - Dependencies - - none - - Known Bugs - - The luma map must be the same size as the B frame. - The PGM parser does not handle comments. - - mix - - Description - - An two stream audio mixer. - - Constructor Argument - - mix - see below - - Initalisation Properties - - int in - in point - int out - out point - - Mutable Properties - - double mix - the mix level to apply to the second frame. - - any negative value causes an automatic crossfade. - - Read Only Properties - - none - - Dependencies - - none - - Known Bugs - - Samples from the longer of the two frames are discarded. - -Consumers ---------- - - bluefish - - Description - - BlueFish444 audio and video output module. - - Constructor Argument - - string video_standard - "PAL" (default) or "NTSC" - - Initialisation Properties - - int video_standard - 0 = PAL, 1 = NTSC - - Read Only Properties - - none - - Dependencies - - BlueVelvet SDK installed parallel to mlt in "bluefish." - - Known Bugs - - Does not work with any service that uses pipes! - - If mlt crashes, you must reload the BlueDriver kernel module - due to unreleased DMA buffers. - - Needs an argument or property for multi-card address. - - ffmpeg - - Description - Constructor Argument - Initialisation Properties - Read Only Properties - Dependencies - Known Bugs - - libdv - - Description - - libdv dv producer. - - Constructor Argument - - string video_standard - "PAL" (default) or "NTSC" - - Initialisation Properties - Read Only Properties - Dependencies - Known Bugs - - sdl - - Description - - Simple DirectMedia Layer audio and video output module. - - Constructor Argument - - string video_standard - "PAL" (default), "NTSC", or "WxH" - - Mutable Properties - - double volume - audio level factor - int video_off - if 1, disable video output - int audio_off - if 1, disable audio output - int scale_overlay - if 1, resample video from source pixel aspect - ratio to square pixels. - - Read Only Properties - - none - - Dependencies - - libSDL-1.2, libasound, libaudio, libXt, libX11, libXext, libSM, libICE - - Known Bugs - - NTSC handling needs tightening up - sdl:NTSC is the only valid - constructor for NTSC playback at the moment. - diff --git a/mlt/docs/testing-20040110.txt b/mlt/docs/testing-20040110.txt deleted file mode 100644 index a8ec933..0000000 --- a/mlt/docs/testing-20040110.txt +++ /dev/null @@ -1,38 +0,0 @@ -On 1/10/2004, Dan Dennedy ran the dv1394d/docs/testing.txt against -mlt albino and miracle. - - -NOTE: Discrepancies cited here may have impact on related functionality. - - -General ------------------------------------------------------------------------------- -Server side error checks and related response error codes are not stringently enforced. - - -Not Implemented ------------------------------------------------------------------------------- -NLS -USET points=ignore -USET eof=terminate -XFER - - -Incorrect Behaviour ------------------------------------------------------------------------------- -killall miracle does not work. requires killall -HUP -USTA when stopped reports "paused" -CLEAN removes all clips (as opposed to leaving the currently playing one) -USET eof=pause is partially supported - - -Different Intentional Behaviour ------------------------------------------------------------------------------- - - -MLT Bugs ------------------------------------------------------------------------------- -Please check the services.txt doc for known bugs related to MLT components. - - - diff --git a/mlt/docs/testing.txt b/mlt/docs/testing.txt deleted file mode 100644 index 8d57a60..0000000 --- a/mlt/docs/testing.txt +++ /dev/null @@ -1,612 +0,0 @@ - -MLT Miracle Test Procedure - -Copyright (C) 2003 Ushodaya Enterprised Limited -Author: Dan Dennedy -Last Revision: 2003-01-17 - -NOTE: THIS DOCUMENT REQUIRES REVISION TO NEW, EXPECTED BEHAVIOR FROM MIRACLE. - -Tests are divided into 9 sections: - - 1. Command Line Usage - 2. Unit Management - 3. Server Configuration - 4. Simple Playback - 5. Multi-unit Playback - 6. Unit Configuration - 7. Advanced Playback - 8. Bus Reset - 9. Server Side Queuing - -Each section contains many tests which I've divided into a minimum of two lines: - -n.m action to carry out ---> expected result - -Further lines may appear to show the actual results when they deviate from what -I expected or if there are special cases to consider. - -Sequential tests are indicated as: - -n.m.o action to carry out ---> expected result - -It is suggested that you run top during the testing and note cpu hikes -or any excessive memory usage related to an operation. - - -0. Introduction ---------------- - -The tests following are by no means exhaustive, but they should cover typical -use cases - creativity is encouraged with more cases being added where necessary. -This document should also be maintained to dictate actual state, especially with -regard to a final release. Unit test cases are encouraged, but are excluded from -this document. - -It is important to carry out the full test cycle when preparing a final release. -In this situation, please resist the temptation to bug fix a given test case and -resume the tests from that point onward - it is better to repeat from the -beginning (but you can of course employ common sense in this situation). - -Before starting the final tests, please delete/backup your current -/etc/dv139d.conf file. This (more or less) ensures that tests are carried out -for a virgin install. - - -1. Command Line Usage ---------------------- - -Run these from the top level project directory - -1.1.0 Start miracle in interactive mode: src/miracle/miracle -test ---> miracle starts interactively and reports: -(5) Starting server on 5250. -(5) miracle version 0.0.1 listening on port 5250 - -1.1.1 Stop the server by pressing Ctrl-C ---> miracle returns the following and returns control to the console: -(5) miracle version 0.0.1 server terminated. - -1.2.2 Start miracle as a daemon: src/miracle/miracle ---> control returns to the console - -1.2.3 Verify miracle is running: ps ax ---> several miracle processes are running - -1.2.4 Verify successful miracle startup using syslog: sudo tail /var/log/syslog ---> miracle: miracle version 0.0.1 listening on port 5250 - -1.2.5 Verify connectivity on port 5250: telnet localhost 5250 ---> 100 VTR Ready - -1.2.6 Test clean disconnect: BYE ---> Connection closed by foreign host. - -1.2.7 Stop the daemon: killall miracle ---> no errors - -1.2.8 Verify a clean server shutdown: sudo tail /var/log/syslog ---> miracle: shutdown complete. - -1.3.0 Start miracle on a different port: src/miracle/miracle -port 5260 - -1.3.1 Verify successful miracle startup using syslog: sudo tail /var/log/syslog ---> miracle: miracle version 0.0.1 listening on port 5260 - -1.3.2 Verify connectivity on port 5260: telnet localhost 5260 ---> 100 VTR Ready - -1.3.3 Test clean disconnect: BYE ---> Connection closed by foreign host. - -1.3.4 Stop the daemon: killall miracle ---> no errors - - -2. Unit Management ------------------- - -Start the miracle server and connect to it with telnet or a protocol- -level client (albino). - -2.1 List the AV/C devices on the bus: NLS ---> 201 OK ---> one or more lines listing devices with GUID in second column - -2.2 Add a device as a miracle unit: UADD {sdl, bluefish}:{NTSC, PAL} ---> 201 OK ---> U0 - -2.3 List the units: ULS ---> 201 OK ---> U0 ?? {sdl, bluefish} 1 ---> It is important that the last column is '1' to indicate it is online. - -2.4 Add an offline unit by using some bogus GUID value: UADD foo ---> 201 OK ---> U1 - -2.3 List the units: ULS ---> 201 OK ---> U0 ?? {GUID} 1 ---> U1 00 0000000f00055c1 0 ---> It is important that the last column of the last row is '0' to - indicate offline. - -2.4 Attempt unit commands for a unit that does not exist: LOAD U6 foo ---> 403 Unit not found - -2.5 Attempt unit commands without specifying a unit: PLAY ---> 402 Argument missing - -2.6 Attempt unit commands for a unit that is offline: PLAY U1 ---> 403 Unit not found - -2.7.0 Load a clip into an offline unit: LOAD U1 test.dv ---> 200 OK - -2.7.1 Verify the status of the offline unit: USTA U1 ---> 202 OK ---> 1 offline "test.dv" 0 1000 25.00 0 ... ---> only the first 3 columns are relevant in this test - -2.9 Set the property of an online unit: USET U0 points=use ---> 200 OK - -2.8 Set the property of an offline unit: USET U1 points=ignore ---> 200 OK - - -3. Server Configuration ------------------------ - -Start miracle if not already started from a previous test. - -3.1 Get the hard-coded default root property value: GET root ---> 202 OK ---> / - -3.2 List the files and subdirectories at the root: CLS / ---> 201 OK ---> "bin/" ---> ... - -3.3 Change the server root to a place where clips are stored: e.g., - SET root=/tmp ---> 200 OK - -3.4 Get the new value of the root property value: GET root ---> 202 OK ---> /tmp/ ---> Notice that if you did not use a trailing slash in step 2.3, one is - added for you and appears in this step. This is normal and correct. - -3.5 List the files and subdirectories at the root: CLS / ---> 201 OK ---> zero or more lines listing subdirectories followed by files. - -3.6 Try to set a property that does not exist: SET foo=bar ---> 405 Argument value out of range - -3.7 Try to set no property or value: SET ---> 402 Argument missing - -3.8 Attempt a bogus command: FOO ---> 400 Unknown command - -XXX 3.9 Attempt the incorrect case for a command: get root -XXX --> 400 Unknown command - -3.10 Attempt case insensitivity of property key: GET Root ---> 202 OK ---> /tmp/ - - -4. Simple Playback -------------------- - -Start miracle or restart if already started. -Add an online unit. -Set the server root property if desired. - -4.1.0 Load a clip into the unit: LOAD U0 test.dv ---> 200 OK - -4.1.1 Check the unit status: USTA U0 ---> 202 OK ---> 0 stopped "test.dv" 0 1000 25.00 0 ... ---> Only the first 3 columns are relevant in this test. ---> The remaining columns are only relevant to the tester. - -4.2.0 Play the clip: PLAY U0 ---> 200 OK ---> Verify audio and video output - -4.2.1 Check the unit status: USTA U0 ---> 202 OK ---> 0 playing "test.dv" 1739 1000 25.00 0 ... ---> Only the first 3 columns are relevant in this test. ---> The remaining columns are only relevant to the tester. - -4.3.0 Pause playback: PAUSE U0 ---> 200 OK ---> Verify video continues, but audio is muted. - -4.3.1 Check the unit status: USTA U0 ---> 202 OK ---> 0 paused "test.dv" 1739 0 25.00 0 ... ---> The fifth column --------^ should be 0; it indicates speed. - -4.3.2 Stop playback: STOP U0 ---> 200 OK ---> The analog video output stops - -4.3.3 Pause playback: PAUSE U0 ---> 200 OK ---> Analog video starts again, but it is held on the same frame - paused in 4.3.0. - -4.3.4 Stop playback: STOP U0 ---> 200 OK ---> The analog video signal ceases. - -4.3.5 Rewind the unit: REW U0 ---> 200 OK - -4.3.6 Play the unit: PLAY U0 ---> 200 OK ---> Analog audio and video are produced from the beginning of the file. - -4.4 Stop the server during playback and ensure clean shutdown. - - -5. Multi-unit Playback ------------------------ - -Start miracle or restart if already started. -Add *2* online units. -Set the server root property if desired. - -5.1.0 Load a clip into one unit: LOAD U0 test.dv ---> 200 OK - -5.1.1 Load a clip into the other unit: LOAD U1 test.dv ---> 200 OK - -5.1.2 Start playing one unit: PLAY U0 ---> 200 OK ---> Verify audio and video output - -5.1.3 Start playing the other unit: PLAY U1 ---> 200 OK ---> Verify audio and video output of both units - -5.2 Verify independence of units by pausing one of them: PAUSE U0 ---> 200 OK ---> Verify video continues, but audio is muted on the first unit only. - -5.3 Stop the server during multi-unit playback and ensure clean shutdown. - - -6. Advanced Playback --------------------- - -Start miracle or restart if already started. -Add *2* online units. -Set the server root property if desired. - -Trick play modes: - -6.1.0 Load a clip: LOAD U0 test.dv ---> 200 OK - -6.1.1 Start playback by pausing on the first frame: PAUSE U0 ---> 200 OK ---> analog video starts, but audio is muted. - -6.1.2 Play fast forward: FF U0 ---> 200 OK ---> verify video is playing fast in the forward direction. - -6.1.3 Get unit status: USTA U0 ---> 202 OK ---> 0 playing "test.dv" 219 2000 25.00 0 ... ---> The important column is --^, indicates speed - -6.1.4 Play fast reverse: REW U0 ---> 200 OK ---> verify analog video output is fast in the reverse direction. - -6.1.5 Get unit status: USTA U0 ---> 202 OK ---> 0 playing "test.dv" 4621 -2000 25.00 0 ... ---> The important column is ---^, negative mean reverse - -6.1.6 Play slow forward: PLAY U0 500 ---> 200 OK ---> Verify the analog video output is slow in the forward direction. - -6.1.7 Play reverse normal speed: PLAY U0 -1000 ---> 200 OK ---> Verify the analog video output is at a normal speed in the reverse direction. ---> Audio output is reverse, but not the field order of video - -Loading while playing: - -6.2.0 Stop the unit (might be playing): STOP U0 ---> 200 OK - -6.2.1 Rewing the unit: REW U0 ---> 200 OK - -6.2.2 Start playing: PLAY U0 ---> 200 OK ---> verify analog audio and video output - -6.2.3 Load another clip: LOAD test002.dv ---> 200 OK ---> playback seamlessly switches to the new clip ---> verify the analog appearance of the video makes a clean switch - -6.2.4 Load another clip, this time with in and out points: - LOAD test.dv 100 500 (whatever works for your test footage) ---> 200 OK ---> verify the analog appearance of the video makes a clean switch - -6.2.5 Get unit status: USTA U0 ---> 202 OK ---> 0 playing "test.dv" 403 1000 25.00 100 ... ---> verify position -----^ is beyond --^ in point, last column is the out - point specified in the previous step. - -Edit points: - -6.3.0 Load a clip: LOAD U0 test.dv ---> 200 OK - -6.3.1 Pause the playback unit: PAUSE U0 ---> 200 OK - -6.3.2 Set the in point: SIN U0 100 ---> 200 OK ---> verify the frame displayed in analog video out changes - -6.3.4 Get the unit status: USTA U0 ---> 202 OK ---> 0 paused "test.dv" 100 0 25.00 100 ... ---> verify position ---^ and in ---^ - -6.3.5 Change the mode of the unit to not restrict playback to the edit - region: USET U0 points=ignore ---> 200 OK - -6.3.6 Jump to a frame before the in frame: GOTO U0 50 ---> 200 OK - -6.3.7 Get the unit status: USTA U0 ---> 202 OK ---> 0 paused "test.dv" 50 0 25.00 100 ... ---> position ----------^ preceeds -^ (in) - -6.3.8 Set the unit mode to restrict playback to the edit region: USET U0 points=use ---> 200 OK ---> verify frame on analog video output changes - -6.3.9 Get the unit status: USTA U0 ---> 202 OK ---> 0 paused "test.dv" 100 0 25.00 100 ... ---> verify position ---^ and in ---^ - -6.3.10 Clear the in point: SIN U0 -1 ---> 200 OK - -6.3.11 Get the unit status: USTA U0 ---> 202 OK ---> 0 paused "test.dv" 100 0 25.00 0 ... ---> verify the in point is reset --^ - -The above sequence should be repeated in a similar manner for the out point -using the SOUT command. - -Transfer: - -6.4.0 Load a clip into the first unit: LOAD U0 test.dv ---> 200 OK - -6.4.1 Load a clip into the second unit: LOAD U1 test002.dv ---> 200 OK - -6.4.2 Start playing the first unit: PLAY U0 ---> 200 OK ---> verify audio and video analog output - -6.4.3 Set an in point on the clip in the second unit: SIN U1 100 ---> 200 OK - -6.4.4 Play the second unit: PLAY U1 ---> 200 OK ---> note the beginning footage - -6.4.5 Transfer the clip from the second to the first unit: XFER U1 U0 ---> 200 OK ---> verify a clean switch on the analog audio and video output of the first unit. ---> upon transfer it should play the same footage previewed in step 6.4.4 - -6.4.5 Get the first unit's status: USTA U0 ---> 202 OK ---> 0 playing "test002.dv" 963 1000 29.97 100 2502 ---> note the in point set from U1 ---------^ - - -7. Unit Configuration ---------------------- - -Start miracle or restart if already started. -Add an online unit. -Set the server root property if desired. - -7.1.0 Load a short clip: LOAD U0 test.dv ---> 200 OK - -7.1.1 Play a clip: PLAY U0 ---> 200 OK ---> Wait until it gets to the end, and it should pause on the last frame. - -7.1.2 Make the clip start looping: USET U0 eof=loop ---> 200 OK ---> verify the clip starts playing from the beginning and loops - -7.2.0 Set the in point: SIN U0 10 ---> 200 OK ---> playback pauses at in point (verify with USTA U0) - -7.2.1 Set the out point: SOUT U0 200 ---> 200 OK ---> playback pauses at in point (verify with USTA U0) - -7.2.2 Start playing again: PLAY U0 ---> 200 OK ---> verify playback loops between in and out points - -7.3 Tell the unit to ignore the edit points: USET U0 points=ignore ---> 200 OK ---> verify playback loops over entire video file - -7.4 Get the current value of the points property: UGET U0 points ---> 202 OK ---> ignore - - -9. Server Side Queuing ----------------------- - -Only one unit is used for these test cases, and -users are encouraged to test with multiple units online. It is assumed that a -number of dv files are available for use in the servers ROOT directory - this -document assumes that they are named test001.dv and up. - -9.1.0 Start miracle in interactive mode and add a unit (all tests will assume U0) ---> server started with unit 0 available - -9.1.1 Obtain a miracle shell (via telnet or albino). ---> 100 VTR (if reported by the client) - -9.1.2 Load a clip with LOAD U0 test001.dv and PAUSE U0 ---> 200 OK - -9.1.3 List the clips with LIST U0 ---> 201 OK ---> 1 ---> 0 "test001.dv" 0 6999 7000 7000 25.00 ---> The 1 on the second line denotes the number of times the list has been changed - via user commands (known as the 'generation' number). ---> The third line and beyond reports the clip index (from 0 to n), file loaded, in point, - out point, real size of the file and the calculated size (out - in + 1 ). - -9.1.4 Check the unit status with USTA U0 ---> 202 OK ---> 0 paused "test001.dv" 0 0 25.00 0 6999 7000 "test001.dv" 0 0 6999 7000 1 1 0 ---> The last two fields indicate the generation number and current clip resp. - -9.1.5 Append a clip with APND U0 test002.dv followed by LIST U0 ---> 201 OK ---> 2 ---> 0 "test001.dv" 0 6999 7000 7000 ---> 1 "test002.dv" 0 6999 7000 7000 ---> Check that USTA U0 reports a generation of 2 and current clip of 0 - -9.1.6 Move clip 1 to clip 0 with MOVE U0 1 0 followed by LIST U0 ---> 201 OK ---> 3 ---> 0 "test002.dv" 0 6999 7000 7000 ---> 1 "test001.dv" 0 6999 7000 7000 ---> Check that USTA U0 reports a generation of 3 and current clip of 1 - -9.1.7 Move clip 0 to clip 1 with MOVE U0 0 1 followed by LIST U0 ---> 201 OK ---> 4 ---> 0 "test001.dv" 0 6999 7000 7000 ---> 1 "test002.dv" 0 6999 7000 7000 ---> Check that USTA U0 reports a generation of 4 and current clip of 0 ---> Note that the order in which you run 9.1.6 and 9.1.7 shouldn't matter as the - result will be identical - -9.1.8 Change the position to the next clip with GOTO U0 0 +1 ---> 200 OK ---> Check that USTA U0 reports a generation of 4 and current clip of 1 - -9.1.9 Remove all but the playing clip with CLEAN U0 followed by LIST U0 ---> 201 OK ---> 5 ---> 0 "test002.dv" 0 6999 7000 7000 ---> Check that USTA U0 reports a generation of 5 and current clip of 0 - -9.1.10 Insert test001.dv back into the list using INSERT U0 test001.dv and run LIST U0 ---> 201 OK ---> 6 ---> 0 "test001.dv" 0 6999 7000 7000 ---> 1 "test002.dv" 0 6999 7000 7000 ---> Check that USTA U0 reports a generation of 6 and current clip of 1 - -9.1.11 Insert test003.dv at position 2 using INSERT U0 test001.dv 3 and run LIST U0 ---> 201 OK ---> 7 ---> 0 "test001.dv" 0 6999 7000 7000 ---> 1 "test002.dv" 0 6999 7000 7000 ---> 2 "test003.dv" 0 6999 7000 7000 ---> Check that USTA U0 reports a generation of 7 and current clip of 1 - -9.1.12 Change the in point of the current clip using SIN U0 5000 and run LIST U0 ---> 201 OK ---> 8 ---> 0 "test001.dv" 0 6999 7000 7000 ---> 1 "test002.dv" 5000 6999 7000 2000 ---> 2 "test003.dv" 0 6999 7000 7000 ---> Check that USTA U0 reports a generation of 8 and current clip of 1 - -9.1.13 Change the out point of the following clip using SOUT U0 5000 +1 and run LIST U0 ---> 201 OK ---> 9 ---> 0 "test001.dv" 0 6999 7000 7000 ---> 1 "test002.dv" 5000 6999 7000 2000 ---> 2 "test003.dv" 0 5000 7000 5001 ---> Check that USTA U0 reports a generation of 9 and current clip of 2 - -9.1.14 Change the in point of the current clip to 1000 using SIN U0 1000 and run LIST U0 ---> 201 OK ---> 10 ---> 0 "test001.dv" 0 6999 7000 7000 ---> 1 "test002.dv" 5000 6999 7000 2000 ---> 2 "test003.dv" 1000 5000 7000 4001 ---> Check that USTA U0 reports a generation of 10 and current clip of 2 - -9.1.15 Ignore the in/out points by running USET U0 points=ignore and run LIST U0 ---> 201 OK ---> 11 ---> 0 "test001.dv" 0 6999 7000 7000 ---> 1 "test002.dv" 5000 6999 7000 7000 ---> 2 "test003.dv" 1000 5000 7000 7000 ---> Check that USTA U0 reports a generation of 11 and current clip of 2 - -9.1.16 Turn the in/out points on again by running USET U0 points=use and run LIST U0 ---> 201 OK ---> 12 ---> 0 "test001.dv" 0 6999 7000 7000 ---> 1 "test002.dv" 5000 6999 7000 2000 ---> 2 "test003.dv" 1000 5000 7000 4001 ---> Check that USTA U0 reports a generation of 12 and current clip of 2 - -9.1.17 Remove the current clip using REMOVE U0 and run LIST U0 ---> 201 OK ---> 13 ---> 0 "test001.dv" 0 6999 7000 7000 ---> 1 "test002.dv" 5000 6999 7000 2000 ---> Check that USTA U0 reports a generation of 13 and current clip of 0 - -9.1.17 Remove the next clip using REMOVE U0 +1 and run LIST U0 ---> 201 OK ---> 14 ---> 0 "test001.dv" 0 6999 7000 7000 ---> Check that USTA U0 reports a generation of 14 and current clip of 0 diff --git a/mlt/docs/valerie.txt b/mlt/docs/valerie.txt deleted file mode 100644 index a5abcce..0000000 --- a/mlt/docs/valerie.txt +++ /dev/null @@ -1,861 +0,0 @@ -VALERIE API Documentation - -Copyright (C) 2003 Ushodaya Enterprised Limited -Author: Charles Yates -Last Revision: 2004-01-11 - - -TABLE OF CONTENTS ------------------ - - 0. Overview - 0.1. Intended Audience - 0.2. Terminology - 1. Definition of a Parser - 1.1. Construction of a Local Parser - 1.2. Construction of a Remote Parser - 1.3. Using the Parser - 1.4. Closing the Parser - 2. The High Level Parser Wrapper - 2.1. Connecting - 2.2. valerie_error_code - 2.3. Using the High Level Wrapper - 2.4. Obtaining Directory Contents - 2.5. Obtaining the Node List - 2.6. Obtaining the Unit List - 2.7. Unit Status Information - 2.8. Server Side Queuing APIs - 2.9. Accessing the Low Level Parser Directly - 2.10. Cleaning up - 2.11. Examples - 3. The Low Level Parser API - 3.1. Executing a Command - 3.2. Interpreting valerie_response - 3.3. Accessing Unit Status - APPENDIX A - COMPILATION AND LINKING - APPENDIX B - COMPLETE HIGH LEVEL PARSER WRAPPER API LISTING - APPENDIX C - COMPLETE LOW LEVEL PARSER API LISTING - APPENDIX D - REFERENCES - - -0. Overview ------------ - - This document details how applications interface to DVCP functionality. - - -0.1. Intended Audience ----------------------- - - This document draws heavily upon the DVCP design (1) and assumes a basic - knowledge of the functionality provided by the DVCP core. - - It is aimed at developers who wish to use or maintain the API. - - -0.2. Terminology ----------------- - - The API is designed to allow client applications the ability to communicate - to a standalone miracle server or entirely embed the DVCP core in an - instance of a client application. - - The distinction between the two is defined by the construction of the - 'parser'. - - This 'parser' can be used to issue DVCP commands and receive responses and - a 'high level parser wrapper' is provided to simplify the usage and - decouple the application from the DVCP command set. - - -1. Definition of a Parser -------------------------- - - The parser provides a low level API which allows text DVCP commands to be - executed with responses being returned to the caller. Commands and - responses are ASCII formatted text. - - Two parsers are provided - local and remote. - - The local parser is the physical implementation which takes commands and - executes them. - - The remote parser is a network abstraction that forwards commands to a - miracle instance that hosts a local parser. - - -1.1. Construction of a Local Parser ------------------------------------ - - To construct a local parser you must have: - - #include - - and code to initialise the parser is as follows: - - valerie_parser parser = miracle_parser_init_local( ); - - See Appendix A for compilation and linking details. - - -1.2. Construction of a Remote Parser ------------------------------------- - - To construct a remote parser you must have: - - #include - - and code to initialise the parser is as follows: - - valerie_parser parser = valerie_parser_init_remote( "server", port ); - - See Appendix A for compilation and linking details. - - -1.3. Using the Parser ---------------------- - - Although the parser can be used directly to send commands and receive - responses, this low level usage puts the onus on the developer to parse the - responses in a meaningful way. - - Although this usage is not strictly forbidden by applications, it is - discouraged as construction of commands and meaningful parsing of responses - leads to the clients being unnecessarily dependent on the servers input and - output. - - As a result, a higher level Parser Wrapper API is provided - this API - encapsulates the command construction and response parsing. - - The following 2 sections provide details on these modes of access. - - -1.4. Closing the Parser ------------------------ - - Regardless of use, it is the constructors responsibility to close the - parser before it goes out of scope. This is done via: - - valerie_parser_close( parser ); - - -2. The High Level Parser Wrapper --------------------------------- - - The recommended way to access the parser, is via the valerie API. To use - this API, you must have: - - #include - - and code to construct the wrapper is: - - valerie dv = valerie_init( parser ); - - Note that either remote or local parsers can be used here and there is no - difference in usage, though some error returns will not be applicable to - both. - - It is recommended that applications honour and deal with the error returns - of both as this allows applications to interchange parsers. - - Also note that valerie is not threadsafe, so you should not use the same - structure in multiple threads. The correct solution to this is to create a - valerie per thread - you may safely use the same parser for each thread ie: - - /* valerie for the application */ - valerie dv = valerie_init( parser ); - /* valerie for the status handling thread. */ - valerie dv_status = valerie_init( parser ); - - For the purposes of simplification, the remainder of this section assumes - that a remote parser is in use. - - -2.1. Connecting ---------------- - - Once constructed, the next thing to do is 'connect': - - valerie_error_code error = valerie_connect( dv ); - - This function call initialises the parser (ie: if it's remote, it - establishes a connection to the server, or if it's local, it initialises - the state of the units and supporting objects). - - Note that if you have multiple valerie instances on the same parser you - should only connect one of the instances. - - -2.2. valerie_error_code ----------------------- - - All but a couple of the functions that make up the valerie API return a - valerie_error_code. - - These are defined as follows: - - valerie_ok = 0, - valerie_malloc_failed, - valerie_unknown_error, - valerie_no_response, - valerie_invalid_command, - valerie_server_timeout, - valerie_missing_argument, - valerie_server_unavailable, - valerie_unit_creation_failed, - valerie_unit_unavailable, - valerie_invalid_file, - valerie_invalid_position - - In most cases, it is sufficient to check on a return of valerie_ok. - - To obtain a textual description of a particular error, you can use: - - char *valerie_error_description( valerie_error_code ); - - -2.3. Using the High Level Wrapper ---------------------------------- - - The following code snippet assumes that dv is an initialised and connected - valerie structure: - - valerie_error_code error = valerie_unit_play( dv, 0 ); - if ( error == valerie_ok ) - fprintf( stderr, "Unit 0 is now playing\n" ); - else - fprintf( stderr, "Play on unit 0 failed: %s\n", - valerie_error_description( error ) ); - - The complete interface to valerie is listed in Appendix B of this document. - - -2.4. Obtaining Directory Contents --------------------------------- - - To obtain a list of files and subdirectories in a given directory relative - to the ROOT property of the server, DVCP provides the CLS command. - - A valid execution of CLS would be something like: - - CLS "/Stuff" - - would provide a response formatted as follows: - - 201 OK - "More Stuff/" - "file0001.dv" 15552000 - "file0002.dv" 15552000 - - with a trailing empty line. - - The first line indicates the error value, the second line shows an example - of a subdirectory and the 3rd and 4th line lists two files that happen to - exist in the directory. - - valerie provides a high level view on this which automatically parses the - response from the server correctly via the valerie_dir structures and - related functions. - - An example of use is as follows: - - valerie_dir dir = valerie_dir_init( dv, "/Stuff" ); - valerie_error_code error = valerie_dir_get_error_code( dir ); - if ( error == valerie_ok ) - { - if ( valerie_dir_count( dir ) > 0 ) - { - valerie_dir_entry_t entry; - int index = 0; - for ( index = 0; index < valerie_dir_count( dir ); index ++ ) - { - valerie_dir_get( dir, index, &entry ); - if ( entry.dir ) - printf( "<%s>\n", entry.name ); - else - printf( "%30s %8d", entry.name, entry.size ); - } - } - else - { - fprintf( stderr, "Directory is empty\n" ); - } - } - else - { - fprintf( stderr, "Directory listing failed: %s\n", - valerie_error_description( error ) ); - } - valerie_dir_close( dir ); - - Note that entry.name provides the name of the file or directory without the - directory prefix. As a convenience, entry.full provides the prefixed name, - so you could subsequently use: - - error = valerie_unit_load( dv, 0, entry.full ); - - to load unit 0 with an entry. - - -2.5. Obtaining the Node List ----------------------------- - - Currently not defined by miracle. - -2.6. Obtaining the Unit List ----------------------------- - - To obtain a list of defined units, DVCP provides the ULS command. - - A valid execution of ULS would be: - - ULS - - and would provide a response formatted as follows: - - 201 OK - U0 00 sdl:360x288 1 - - with a trailing empty line. - - The fields of each record in the response dictate unit, node, mlt consumer and - online status respectively. - - valerie provides a high level view on this which automatically parses the - response from the server correctly via the valerie_units structures and - related functions. - - An example of use is as follows: - - valerie_units units = valerie_units_init( dv ); - valerie_error_code error = valerie_units_get_error_code( units ); - if ( error == valerie_ok ) - { - if ( valerie_units_count( units ) > 0 ) - { - valerie_unit_entry_t entry; - int index = 0; - for ( index = 0; index < valerie_units_count( units ); index ++ ) - { - valerie_units_get( units, index, &entry ); - printf( "U%d %02d %s %s\n", - entry.unit, - entry.node, - entry.guid, - entry.online ? "online" : "offline" ); - } - } - else - { - fprintf( stderr, "Unit list is empty\n" ); - } - } - else - { - fprintf( stderr, "Unit listing failed: %s\n", - valerie_error_description( error ) ); - } - valerie_units_close( units ); - - -2.7. Unit Status Information ----------------------------- - - There are two methods for a client to obtain unit status information. - - The first is via the DVCP USTA command, which would normally be accessed - via: - - USTA U0 - - and would provide a response formated as follows: - - 202 OK - 0 playing "a.dv" 58 1000 25.00 0 6999 7000 "a.dv" 157 0 6999 7000 1 4 0 - - with no trailing empty line. - - The entries in the record are: - - * Unit - * State (undefined, offline, not_loaded, stopped, playing, - paused, disconnected [when server dies]) - * Name of Clip - * Position in clip - * Speed * 1000 - * Frames per second - * Start of clip (in point) - * End of clip (out point) - * Length of clip - * Read ahead clip - * Read ahead position - * Read ahead clip in - * Read ahead clip out - * Read ahead clip length - * Seekable flag - * Playlist generation - * Clip index - - Again, valerie provides a high level means for obtaining this via the - valerie_unit_status function and valerie_status structures: - - valerie_status_t status; - valerie_error_code error = valerie_unit_status( dv, 0, &status ); - if ( error == valerie_ok ) - { - switch( status.status ) - { - case unit_offline: - printf( "offline " ); - break; - case unit_undefined: - printf( "undefined " ); - break; - case unit_not_loaded: - printf( "unloaded " ); - break; - case unit_stopped: - printf( "stopped " ); - break; - case unit_playing: - printf( "playing " ); - break; - default: - printf( "unknown " ); - break; - } - - printf( "%06lld %06lld %06lld %s\n", status.in, - status.position, - status.out, - status.clip ); - } - else - { - fprintf( stderr, "Unit status failed: %s\n", - valerie_error_description( error ) ); - } - - The second approach for obtaining a units status is via automatic - notification. - - This is done via the valerie_notifier API. To obtain the notifier from the - high level API, you can use: - - valerie_notifier notifier = valerie_get_notifier( dv ); - - To obtain the last status associated to a unit, you can use: - - int unit = 1; - valerie_status_t status; - valerie_notifier_get( notifier, &status, unit ); - - To wait for the next status from any unit, you can use: - - valerie_notifier_wait( notifier, &status ); - - If you wish to trigger the action associated to your applications wait - handling of a particular unit, you can use: - - valerie_notifier_get( notifier, &status, unit ); - valerie_notifier_put( notifier, &status ); - - See Examples below for details on this. - - The complete list of fields in the status structure are: - - int unit; - unit_status status; - char clip[ 2048 ]; - int64_t position; - int speed; - double fps; - int64_t in; - int64_t out; - int64_t length; - char tail_clip[ 2048 ]; - int64_t tail_position; - int64_t tail_in; - int64_t tail_out; - int64_t tail_length; - int seekable; - int generation; - int clip_index; - - You will always receive a status record for every frame output. - - The read ahead information is provided for client side queuing. Client side - queuing assumes that uset eof=pause is applied to the unit. A client can - detect when the previously scheduled clip is played out by using the read - ahead information and schedule the next clip. While this mode of operation - is still supported, it is recommended that new clients use the server side - queuing mechanism which is described in the following section. - - -2.8. Server Side Queueing APIs ------------------------------- - - This section describes the APIs available to provide server side queueing. - - The concept is that each unit maintains its own playlist, containing multiple - clips. Associated to the playlist is a generation number which is incremented - on each modification to the playlist. The current playlist generation is - provided in the status record in order for a client to know when to refresh - its presentation of the list. The status record also indicates which clip is - currently active. - - Actions that can be carried out on the playlist are summarised as: - - * list - list all the clips and associated in/out points and size - * loading a clip - a load will wipe the current list and replace it with the - specified clip - * appending a clip - append will always place the specified clip at the end - of the playlist - * inserting a clip - insert will place a new clip at the specified position - in the playlist - * moving a clip - move will allow clips can be moved in the playlist - * removing a clip - remove will remove the specified clip from the playlist - * clean - clean will remove all but the playing clip from the playlist - - Additionally, the following existing actions are clip aware: - - * goto allows you to move the current play position to a specific clip position - * set in/out points allows you to modify clip in and out points - - Backward compatability has been maintained by the addition of a clip-aware - family of APIs which have the naming convention of valerie_unit_clip_*. - - These are listed in Appendix B. - - The following shows an example of obtaining the clips queued on unit 0: - - valerie_list list = valerie_list_init( dv, 0 ); - valerie_list_entry_t entry; - int index; - - printf( "Generation = %d\n", list->generation ); - for ( index = 0; index < valerie_list_count( list ); index ++ ) - { - valerie_list_get( list, index, &entry ); - printf( "%d %s %d %d %d %d\n", - entry.clip, - entry.full, - entry.in, - entry.out, - entry.max, - entry.size ); - } - valerie_list_close( list ); - - To load a clip on unit 0: - - valerie_unit_load( dv, 0, "/path/clip.dv" ); - - To append a clip on unit 0: - - valerie_unit_append( dv, 0, "/path/clip.dv", -1, -1 ); - - Note that the last two arguments specify the in and out points of the clip - with -1 denoting dfaults of the entirety of the file. - - To insert a clip at position 0 on unit 0, we can use the following: - - valerie_unit_clip_insert( dv, 0, clip_absolute, 0, "/path/clip.dv", -1, -1 ); - - The 3rd and 4th arguments here are common to all the valerie_unit_clip functions. - They take the form of either [clip_absolute, n] to indicate an absolute clip - index, or [clip_relative, n] to indicate a clip index relative to the - currently playing clip. - - So, to insert a clip immediately before the currently playing clip, we can - use: - - valerie_unit_clip_insert( dv, 0, clip_relative, -1, "/path/clip.dv", -1, -1 ); - - To move the current clip to the next position in the list: - - valerie_unit_clip_move( dv, 0, clip_relative, 0, clip_relative, 1 ); - - To remove a specific clip: - - valerie_unit_clip_remove( dv, 0, clip_absolute, index ); - - To remove all but the currently playing clip: - - valerie_unit_clean( dv, 0 ); - - To goto the first frame in the first clip, you can use: - - valerie_unit_clip_goto( dv, 0, clip_absolute, 0, 0 ); - - To set the in and out points on the current clip: - - valerie_unit_clip_set_in( dv, 0, clip_relative, 0, 0 ); - valerie_unit_clip_set_out( dv, 0, clip_relative, 0, 1000 ); - - A more complete example of use of the server side can queuing can be found - at: - - http://users.pandora.be/acp/gdv1394 - - The demo client provided with valerie is used for retaining backward - compatability with the client side queuing API. - - -2.9. Accessing the Low Level Parser Directly --------------------------------------------- - - The low level parser and its associated structures can be accessed directly - from the high level API, but is very occasionally actually needed. - - The methods are provided via a pair of high level methods: - - valerie_error_code error = valerie_execute( dv, 1024, "USTA U%d", unit ); - valerie_response response = valerie_get_last_response( dv ); - int index = 0; - for ( index = 0; index < valerie_response_count( response ); index ++ ) - printf( "%d: %s\n", index, valerie_response_get_line( response,index ) ); - - More details on the valerie_response structure can be found in section 3 of this - document. - - -2.10. Cleaning up ------------------ - - Before the valerie and parser go out of scope, you need to run: - - valerie_close( dv ); - valerie_parser_close( parser ); - - Note that you should close all valerie instances before closing the parser. - - -2.11. Examples --------------- - - Please refer to albino and humperdink source for examples provided with - the project. Additional examples can be found via google with gdv1394 and - poldo. - - -3. The Low Level Parser API ---------------------------- - - The low level parser API provides a very simple mechanism for constructing - commands and receiving responses. - - As described in section 2, a parser is constructed as local or remote and - this is sufficient for constructing the low level parser. - - -3.1. Executing a Command ------------------------- - - All commands can be executed via the single variable argument function - valerie_parser_executef and this function returns a valerie_response, ie: - - valerie_response response = valerie_parser_executef( parser, "CLS \"%s\"", dir ); - - Note that no carriage return/line feed is required (adding this is - erroneous). - - It is the receiver of the response who is responsible for closing it. - - valerie_response_close( response ); - - -3.2. Interpreting valerie_response ------------------------------ - - The response received can be NULL, but it is safe to call: - - int error = valerie_response_get_error_code( response ); - - which will return: - - * -1 if response is NULL, - * -2 if there is no content to the response, - * 0 if the responses first line does not correspond to a valid DVCP response - * or the DVCP protocol error code returned on the first line of the response - - A simple use of a valerie_response structure is as follows: - - valerie_response response = valerie_parser_executef( parser, "CLS \"%s\"", dir ); - int error = valerie_response_get_error_code( response ); - if ( error >= 0 ) - { - int index = 0; - for ( index = 0; index < valerie_response_count( response ); index ++ ) - printf( "%3d: %s\n", index, valerie_response_get_line( response, index ) ); - } - else - { - /* interpret error */ - } - valerie_response_close( response ); - - Note that it is safe to call valerie_response_close regardless of the error - condition indicated. - - -3.3. Accessing Unit Status --------------------------- - - As with the high level parser, there are two alternatives to obtain unit - status information - either via the USTA DVCP command or via the - valerie1394_notifier. - - The latter is the recommended way for any applications which wish to extract - meaningful information from the status while avoiding the requirement to - duplicate the parsing process in a specific client. - - The notifier can be obtained by: - - valerie_notifier notifier = valerie_parser_get_notifier( parser ); - - The use of the notifier with the low level parser is identical to that - dictated in Section 2 - to obtain the last status associated to a unit, - you can use: - - int unit = 1; - valerie_status_t status; - valerie_notifier_get( notifier, &status, unit ); - - To wait for the next status from any unit, you can use: - - valerie_notifier_wait( notifier, &status ); - - -APPENDIX A - COMPILATION AND LINKING ------------------------------------- - - Compilation flags are: - - -I /include - - where prefix defaults to /usr/local. - - Linking flags for a client are: - - -L /lib/ -lvalerie - - Or for a local parser: - - -L /lib/ -lmiracle - - Note that you never need both libs. - - -APPENDIX B - COMPLETE HIGH LEVEL PARSER WRAPPER API LISTING ------------------------------------------------------------ - - valerie valerie_init( valerie_parser ); - - valerie_error_code valerie_connect( valerie ); - - valerie_error_code valerie_set( valerie, char *, char * ); - valerie_error_code valerie_get( valerie, char *, char *, int ); - - valerie_error_code valerie_unit_add( valerie, char * ); - valerie_error_code valerie_unit_load( valerie, int, char * ); - valerie_error_code valerie_unit_load_clipped( valerie,int,char *,long,long ); - valerie_error_code valerie_unit_load_back( valerie, int, char * ); - valerie_error_code valerie_unit_load_back_clipped(valerie,int,char *,long,long) - valerie_error_code valerie_unit_play( valerie, int ); - valerie_error_code valerie_unit_play_at_speed( valerie, int, int ); - valerie_error_code valerie_unit_stop( valerie, int ); - valerie_error_code valerie_unit_pause( valerie, int ); - valerie_error_code valerie_unit_rewind( valerie, int ); - valerie_error_code valerie_unit_fast_forward( valerie, int ); - valerie_error_code valerie_unit_step( valerie, int, int ); - valerie_error_code valerie_unit_goto( valerie, int, int ); - valerie_error_code valerie_unit_set_in( valerie, int, int ); - valerie_error_code valerie_unit_set_out( valerie, int, int ); - valerie_error_code valerie_unit_clear_in( valerie, int ); - valerie_error_code valerie_unit_clear_out( valerie, int ); - valerie_error_code valerie_unit_clear_in_out( valerie, int ); - valerie_error_code valerie_unit_set( valerie, int, char *, char * ); - valerie_error_code valerie_unit_get( valerie, int, char * ); - - valerie_error_code valerie_unit_status( valerie, int, valerie_status ); - valerie_notifier valerie_get_notifier( valerie ); - - valerie_dir valerie_dir_init( valerie, char * ); - valerie_error_code valerie_dir_get( valerie_dir, int, valerie_dir_entry ); - int valerie_dir_count( valerie_dir ); - void valerie_dir_close( valerie_dir ); - - valerie_nodes valerie_nodes_init( valerie ); - valerie_error_code valerie_nodes_get(valerie_nodes,int,valerie_node_entry); - int valerie_nodes_count( valerie_nodes ); - void valerie_nodes_close( valerie_nodes ); - - valerie_units valerie_units_init( valerie ); - valerie_error_code valerie_units_get(valerie_units,int,valerie_unit_entry); - int valerie_units_count( valerie_units ); - void valerie_units_close( valerie_units ); - - valerie_response valerie_get_last_response( valerie ); - - valerie_error_code valerie_execute( valerie, size_t, char *, ... ); - - void valerie_close( valerie ); - - Notifier Functions - ------------------ - - void valerie_notifier_get( valerie_notifier, valerie_status, int ); - void valerie_notifier_put( valerie_notifier, valerie_status ); - int valerie_notifier_wait( valerie_notifier, valerie_status ); - void valerie_notifier_close( valerie_notifier ); - - Server Side Queuing - ------------------- - - valerie_list valerie_list_init( valerie, int ) - valerie_error_code valerie_list_get_error_code( valerie_list ) - valerie_error_code valerie_list_get( valerie_list, int, valerie_list_entry ) - int valerie_list_count( valerie_list ) - void valerie_list_close( valerie_list ) - - valerie_error_code valerie_unit_clean( valerie dv, int unit ) - valerie_error_code valerie_unit_append( valerie dv, int unit, char *file, int in, int out ) - valerie_error_code valerie_unit_remove_current_clip( valerie dv, int unit ) - - valerie_error_code valerie_unit_clip_goto( valerie dv, int unit, valerie_clip_offset offset, int clip, int position ) - valerie_error_code valerie_unit_clip_set_in( valerie dv, int unit, valerie_clip_offset offset, int clip, int in ) - valerie_error_code valerie_unit_clip_set_out( valerie dv, int unit, valerie_clip_offset offset, int clip, int in ) - valerie_error_code valerie_unit_clip_move( valerie dv, int unit, valerie_clip_offset offset, int src, valerie_clip_offset offset, int dest ) - valerie_error_code valerie_unit_clip_remove( valerie dv, int unit, valerie_clip_offset offset, int clip ) - valerie_error_code valerie_unit_clip_insert( valerie dv, int unit, valerie_clip_offset offset, int clip, char *file, int in, int out ) - - - -APPENDIX C - COMPLETE LOW LEVEL PARSER API LISTING --------------------------------------------------- - - valerie_response valerie_parser_connect( valerie_parser ); - valerie_response valerie_parser_execute( valerie_parser, char * ); - valerie_response valerie_parser_executef( valerie_parser, char *, ... ); - valerie_response valerie_parser_run( valerie_parser, char * ); - valerie_notifier valerie_parser_get_notifier( valerie_parser ); - void valerie_parser_close( valerie_parser ); - - valerie_response valerie_response_init( ); - valerie_response valerie_response_clone( valerie_response ); - int valerie_response_get_error_code( valerie_response ); - char *valerie_response_get_error_string( valerie_response ); - char *valerie_response_get_line( valerie_response, int ); - int valerie_response_count( valerie_response ); - void valerie_response_set_error( valerie_response, int, char * ); - int valerie_response_printf( valerie_response, size_t, char *, ... ); - int valerie_response_write( valerie_response, char *, int ); - void valerie_response_close( valerie_response ); - - -APPENDIX D - REFERENCES ------------------------ - - (1) doc/dvcp.txt - DVCP protocol - (2) doc/testing.txt - Test procedures diff --git a/mlt/setenv b/mlt/setenv deleted file mode 100644 index 809cb1c..0000000 --- a/mlt/setenv +++ /dev/null @@ -1,21 +0,0 @@ - -# Environment variable settings to allow execution without install - -export MLT_REPOSITORY=`pwd`/src/modules - -export LD_LIBRARY_PATH=\ -`pwd`/src/framework:\ -`pwd`/src/valerie:\ -`pwd`/src/miracle:\ -`pwd`/src/modules/bluefish:\ -`pwd`/../bluefish/lib:\ -`pwd`/../mpeg_sdk_demo/bin:\ -`pwd`/../dv_sdk - -export PATH=\ -`pwd`/src/albino:\ -`pwd`/src/inigo:\ -`pwd`/src/humperdink:\ -`pwd`/src/miracle:\ -$PATH - diff --git a/mlt/src/albino/Makefile b/mlt/src/albino/Makefile deleted file mode 100644 index 051c5fe..0000000 --- a/mlt/src/albino/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -TARGET = albino - -OBJS = albino.o - -CFLAGS = -I .. -Wall -g -D_FILE_OFFSET_BITS=64 -pthread -rdynamic - -LDFLAGS = -L ../valerie -L ../miracle -L ../framework -lmiracle -lmlt -lvalerie - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/albino/albino.c b/mlt/src/albino/albino.c deleted file mode 100644 index 28dc6f5..0000000 --- a/mlt/src/albino/albino.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * albino.c -- Local dv1394d Test Util - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -/* System header files */ -#include -#include -#include - -/* Application header files */ -#include -#include -#include - -char *prompt( char *command, int length ) -{ - printf( "> " ); - return fgets( command, length, stdin ); -} - -void report( valerie_response response ) -{ - int index = 0; - if ( response != NULL ) - for ( index = 0; index < valerie_response_count( response ); index ++ ) - printf( "%4d: %s\n", index, valerie_response_get_line( response, index ) ); -} - -int main( int argc, char **argv ) -{ - valerie_parser parser = NULL; - valerie_response response = NULL; - char temp[ 1024 ]; - int index = 1; - - if ( argc > 2 && !strcmp( argv[ 1 ], "-s" ) ) - { - printf( "DV1394D Client Instance\n" ); - parser = valerie_parser_init_remote( argv[ 2 ], 5250 ); - response = valerie_parser_connect( parser ); - index = 3; - } - else - { - printf( "DV1394D Standalone Instance\n" ); - parser = miracle_parser_init_local( ); - response = valerie_parser_connect( parser ); - } - - if ( response != NULL ) - { - /* process files on command lines before going into console mode */ - for ( ; index < argc; index ++ ) - { - valerie_response_close( response ); - response = valerie_parser_run( parser, argv[ index ] ); - report( response ); - } - - while ( response != NULL && prompt( temp, 1024 ) ) - { - valerie_util_trim( valerie_util_chomp( temp ) ); - if ( !strcasecmp( temp, "BYE" ) ) - { - break; - } - else if ( strcmp( temp, "" ) ) - { - valerie_response_close( response ); - response = valerie_parser_execute( parser, temp ); - report( response ); - } - } - } - else - { - fprintf( stderr, "Unable to connect to a dv1394 instance.\n" ); - } - - printf( "\n" ); - valerie_parser_close( parser ); - - return 0; -} diff --git a/mlt/src/framework/Makefile b/mlt/src/framework/Makefile deleted file mode 100644 index 6d80401..0000000 --- a/mlt/src/framework/Makefile +++ /dev/null @@ -1,41 +0,0 @@ - -TARGET = libmlt.so - -OBJS = mlt_frame.o \ - mlt_property.o \ - mlt_properties.o \ - mlt_service.o \ - mlt_producer.o \ - mlt_multitrack.o \ - mlt_playlist.o \ - mlt_consumer.o \ - mlt_filter.o \ - mlt_transition.o \ - mlt_field.o \ - mlt_tractor.o \ - mlt_factory.o \ - mlt_repository.o - -SRCS := $(OBJS:.o=.c) - -CFLAGS = -g -Wall -D_FILE_OFFSET_BITS=64 -pthread - -LDFLAGS = -lm -ldl -lpthread - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) -shared -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/framework/config.h b/mlt/src/framework/config.h deleted file mode 100644 index fec9861..0000000 --- a/mlt/src/framework/config.h +++ /dev/null @@ -1,10 +0,0 @@ -/** GENERATED FILE - DON'T EDIT */ - -#ifndef _MLT_CONFIG_H_ -#define _MLT_CONFIG_H_ - -#define PREFIX "/usr/local" -#define PREFIX_DATA PREFIX "/share" - -#endif - diff --git a/mlt/src/framework/configure b/mlt/src/framework/configure deleted file mode 100755 index a9bf588..0000000 --- a/mlt/src/framework/configure +++ /dev/null @@ -1 +0,0 @@ -#!/bin/bash diff --git a/mlt/src/framework/mlt.h b/mlt/src/framework/mlt.h deleted file mode 100644 index 3ad47a0..0000000 --- a/mlt/src/framework/mlt.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * mlt.h -- header file for lazy client and implementation code :-) - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_H_ -#define _MLT_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include "mlt_factory.h" -#include "mlt_frame.h" -#include "mlt_multitrack.h" -#include "mlt_producer.h" -#include "mlt_transition.h" -#include "mlt_consumer.h" -#include "mlt_filter.h" -#include "mlt_manager.h" -#include "mlt_playlist.h" -#include "mlt_properties.h" -#include "mlt_field.h" -#include "mlt_tractor.h" - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/mlt/src/framework/mlt_consumer.c b/mlt/src/framework/mlt_consumer.c deleted file mode 100644 index 6c751aa..0000000 --- a/mlt/src/framework/mlt_consumer.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * mlt_consumer.c -- abstraction for all consumer services - * 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 program 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. - * - * 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. - */ - -#include "config.h" -#include "mlt_consumer.h" -#include -#include -#include - -/** Public final methods -*/ - -int mlt_consumer_init( mlt_consumer this, void *child ) -{ - memset( this, 0, sizeof( struct mlt_consumer_s ) ); - this->child = child; - return mlt_service_init( &this->parent, this ); -} - -/** Get the parent service object. -*/ - -mlt_service mlt_consumer_service( mlt_consumer this ) -{ - return &this->parent; -} - -/** Get the consumer properties. -*/ - -mlt_properties mlt_consumer_properties( mlt_consumer this ) -{ - return mlt_service_properties( &this->parent ); -} - -/** Connect the consumer to the producer. -*/ - -int mlt_consumer_connect( mlt_consumer this, mlt_service producer ) -{ - return mlt_service_connect_producer( &this->parent, producer, 0 ); -} - -/** Start the consumer. -*/ - -int mlt_consumer_start( mlt_consumer this ) -{ - if ( this->start != NULL ) - return this->start( this ); - return 0; -} - -/** Stop the consumer. -*/ - -int mlt_consumer_stop( mlt_consumer this ) -{ - if ( this->stop != NULL ) - return this->stop( this ); - return 0; -} - -/** Determine if the consumer is stopped. -*/ - -int mlt_consumer_is_stopped( mlt_consumer this ) -{ - if ( this->is_stopped != NULL ) - return this->is_stopped( this ); - return 0; -} - -/** Close the consumer. -*/ - -void mlt_consumer_close( mlt_consumer this ) -{ - // Get the childs close function - void ( *consumer_close )( ) = this->close; - - // Make sure it only gets called once - this->close = NULL; - - // Call the childs close if available - if ( consumer_close != NULL ) - consumer_close( this ); - else - mlt_service_close( &this->parent ); -} - diff --git a/mlt/src/framework/mlt_consumer.h b/mlt/src/framework/mlt_consumer.h deleted file mode 100644 index 6c4164b..0000000 --- a/mlt/src/framework/mlt_consumer.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * mlt_consumer.h -- abstraction for all consumer services - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_CONSUMER_H_ -#define _MLT_CONSUMER_H_ - -#include "mlt_service.h" - -/** The interface definition for all consumers. -*/ - -struct mlt_consumer_s -{ - // We're implementing service here - struct mlt_service_s parent; - - // public virtual - int ( *start )( mlt_consumer ); - int ( *stop )( mlt_consumer ); - int ( *is_stopped )( mlt_consumer ); - void ( *close )( mlt_consumer ); - - // Private data - void *private; - void *child; -}; - -/** Public final methods -*/ - -extern int mlt_consumer_init( mlt_consumer this, void *child ); -extern mlt_service mlt_consumer_service( mlt_consumer this ); -extern mlt_properties mlt_consumer_properties( mlt_consumer this ); -extern int mlt_consumer_connect( mlt_consumer this, mlt_service producer ); -extern int mlt_consumer_start( mlt_consumer this ); -extern int mlt_consumer_stop( mlt_consumer this ); -extern int mlt_consumer_is_stopped( mlt_consumer this ); -extern void mlt_consumer_close( mlt_consumer ); - -#endif diff --git a/mlt/src/framework/mlt_factory.c b/mlt/src/framework/mlt_factory.c deleted file mode 100644 index 9223178..0000000 --- a/mlt/src/framework/mlt_factory.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * mlt_factory.c -- the factory method interfaces - * 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 program 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. - * - * 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. - */ - -#include "config.h" -#include "mlt.h" -#include "mlt_repository.h" - -#include -#include - -/** Singleton repositories -*/ - -static char *mlt_prefix = NULL; -static mlt_properties object_list = NULL; -static mlt_repository producers = NULL; -static mlt_repository filters = NULL; -static mlt_repository transitions = NULL; -static mlt_repository consumers = NULL; - -/** Construct the factories. -*/ - -int mlt_factory_init( char *prefix ) -{ - // Only initialise once - if ( mlt_prefix == NULL ) - { - // If no directory is specified, default to install directory - if ( prefix == NULL ) - prefix = PREFIX_DATA; - - // Store the prefix for later retrieval - mlt_prefix = strdup( prefix ); - - // Create the object list. - object_list = calloc( sizeof( struct mlt_properties_s ), 1 ); - mlt_properties_init( object_list, NULL ); - - // Create a repository for each service type - producers = mlt_repository_init( object_list, prefix, "producers.dat", "mlt_create_producer" ); - filters = mlt_repository_init( object_list, prefix, "filters.dat", "mlt_create_filter" ); - transitions = mlt_repository_init( object_list, prefix, "transitions.dat", "mlt_create_transition" ); - consumers = mlt_repository_init( object_list, prefix, "consumers.dat", "mlt_create_consumer" ); - } - - return 0; -} - -/** Fetch the prefix used in this instance. -*/ - -const char *mlt_factory_prefix( ) -{ - return mlt_prefix; -} - -/** Fetch a producer from the repository. -*/ - -mlt_producer mlt_factory_producer( char *service, void *input ) -{ - mlt_producer obj = mlt_repository_fetch( producers, service, input ); - if ( obj != NULL ) - { - mlt_properties properties = mlt_producer_properties( obj ); - mlt_properties_set( properties, "mlt_type", "producer" ); - mlt_properties_set( properties, "mlt_service", service ); - } - return obj; -} - -/** Fetch a filter from the repository. -*/ - -mlt_filter mlt_factory_filter( char *service, void *input ) -{ - mlt_filter obj = mlt_repository_fetch( filters, service, input ); - if ( obj != NULL ) - { - mlt_properties properties = mlt_filter_properties( obj ); - mlt_properties_set( properties, "mlt_type", "filter" ); - mlt_properties_set( properties, "mlt_service", service ); - } - return obj; -} - -/** Fetch a transition from the repository. -*/ - -mlt_transition mlt_factory_transition( char *service, void *input ) -{ - mlt_transition obj = mlt_repository_fetch( transitions, service, input ); - if ( obj != NULL ) - { - mlt_properties properties = mlt_transition_properties( obj ); - mlt_properties_set( properties, "mlt_type", "transition" ); - mlt_properties_set( properties, "mlt_service", service ); - } - return obj; -} - -/** Fetch a consumer from the repository -*/ - -mlt_consumer mlt_factory_consumer( char *service, void *input ) -{ - mlt_consumer obj = mlt_repository_fetch( consumers, service, input ); - if ( obj != NULL ) - { - mlt_properties properties = mlt_consumer_properties( obj ); - mlt_properties_set( properties, "mlt_type", "consumer" ); - mlt_properties_set( properties, "mlt_service", service ); - } - return obj; -} - -/** Close the factory. -*/ - -void mlt_factory_close( ) -{ - if ( mlt_prefix != NULL ) - { - mlt_repository_close( producers ); - mlt_repository_close( filters ); - mlt_repository_close( transitions ); - mlt_repository_close( consumers ); - mlt_properties_close( object_list ); - free( mlt_prefix ); - free( object_list ); - mlt_prefix = NULL; - } -} - diff --git a/mlt/src/framework/mlt_factory.h b/mlt/src/framework/mlt_factory.h deleted file mode 100644 index d0b9160..0000000 --- a/mlt/src/framework/mlt_factory.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * mlt_factory.h -- the factory method interfaces - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_FACTORY_H -#define _MLT_FACTORY_H - -#include "mlt_types.h" - -extern int mlt_factory_init( char *prefix ); -extern const char *mlt_factory_prefix( ); -extern mlt_producer mlt_factory_producer( char *name, void *input ); -extern mlt_filter mlt_factory_filter( char *name, void *input ); -extern mlt_transition mlt_factory_transition( char *name, void *input ); -extern mlt_consumer mlt_factory_consumer( char *name, void *input ); -extern void mlt_factory_close( ); - -#endif diff --git a/mlt/src/framework/mlt_field.c b/mlt/src/framework/mlt_field.c deleted file mode 100644 index 8a7f51f..0000000 --- a/mlt/src/framework/mlt_field.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - * mlt_field.c -- A field for planting multiple transitions and filters - * 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 program 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. - * - * 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. - */ - -#include "mlt_field.h" -#include "mlt_service.h" -#include "mlt_filter.h" -#include "mlt_transition.h" -#include "mlt_multitrack.h" -#include "mlt_tractor.h" - -#include -#include - -/** Private structures. -*/ - -struct mlt_field_s -{ - // This is the producer we're connected to - mlt_service producer; - - // Multitrack - mlt_multitrack multitrack; - - // Tractor - mlt_tractor tractor; -}; - -/** Constructor. - - We construct a multitrack and a tractor here. -*/ - -mlt_field mlt_field_init( ) -{ - // Initialise the field - mlt_field this = calloc( sizeof( struct mlt_field_s ), 1 ); - - // Initialise it - if ( this != NULL ) - { - // Construct a multitrack - this->multitrack = mlt_multitrack_init( ); - - // Construct a tractor - this->tractor = mlt_tractor_init( ); - - // The first plant will be connected to the mulitrack - this->producer = mlt_multitrack_service( this->multitrack ); - - // Connect the tractor to the multitrack - mlt_tractor_connect( this->tractor, this->producer ); - } - - // Return this - return this; -} - -/** Get the service associated to this field. -*/ - -mlt_service mlt_field_service( mlt_field this ) -{ - return mlt_tractor_service( this->tractor ); -} - -/** Get the multi track. -*/ - -mlt_multitrack mlt_field_multitrack( mlt_field this ) -{ - return this->multitrack; -} - -/** Get the tractor. -*/ - -mlt_tractor mlt_field_tractor( mlt_field this ) -{ - return this->tractor; -} - -/** Get the properties associated to this field. -*/ - -mlt_properties mlt_field_properties( mlt_field this ) -{ - return mlt_service_properties( mlt_field_service( this ) ); -} - -/** Plant a filter. -*/ - -int mlt_field_plant_filter( mlt_field this, mlt_filter that, int track ) -{ - // Connect the filter to the last producer - int result = mlt_filter_connect( that, this->producer, track ); - - // If sucessful, then we'll use this for connecting in the future - if ( result == 0 ) - { - // This is now the new producer - this->producer = mlt_filter_service( that ); - - // Reconnect tractor to new producer - mlt_tractor_connect( this->tractor, this->producer ); - } - - return result; -} - -/** Plant a transition. -*/ - -int mlt_field_plant_transition( mlt_field this, mlt_transition that, int a_track, int b_track ) -{ - // Connect the transition to the last producer - int result = mlt_transition_connect( that, this->producer, a_track, b_track ); - - // If sucessful, then we'll use this for connecting in the future - if ( result == 0 ) - { - // This is now the new producer - this->producer = mlt_transition_service( that ); - - // Reconnect tractor to new producer - mlt_tractor_connect( this->tractor, this->producer ); - } - - return 0; -} - -/** Close the field. -*/ - -void mlt_field_close( mlt_field this ) -{ - mlt_tractor_close( this->tractor ); - mlt_multitrack_close( this->multitrack ); - free( this ); -} - diff --git a/mlt/src/framework/mlt_field.h b/mlt/src/framework/mlt_field.h deleted file mode 100644 index d84d0cc..0000000 --- a/mlt/src/framework/mlt_field.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * mlt_field.h -- A field for planting multiple transitions and services - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_FIELD_H_ -#define _MLT_FIELD_H_ - -#include "mlt_types.h" - -extern mlt_field mlt_field_init( ); -extern mlt_service mlt_field_service( mlt_field this ); -extern mlt_tractor mlt_field_tractor( mlt_field this ); -extern mlt_multitrack mlt_field_multitrack( mlt_field this ); -extern mlt_properties mlt_field_properties( mlt_field this ); -extern int mlt_field_plant_filter( mlt_field this, mlt_filter that, int track ); -extern int mlt_field_plant_transition( mlt_field this, mlt_transition that, int a_track, int b_track ); -extern void mlt_field_close( mlt_field this ); - -#endif - diff --git a/mlt/src/framework/mlt_filter.c b/mlt/src/framework/mlt_filter.c deleted file mode 100644 index 6e39e79..0000000 --- a/mlt/src/framework/mlt_filter.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - * mlt_filter.c -- abstraction for all filter services - * 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 program 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. - * - * 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. - */ - -#include "config.h" - -#include "mlt_filter.h" -#include "mlt_frame.h" - -#include -#include -#include - -static int filter_get_frame( mlt_service this, mlt_frame_ptr frame, int index ); - -/** Constructor method. -*/ - -int mlt_filter_init( mlt_filter this, void *child ) -{ - mlt_service service = &this->parent; - memset( this, 0, sizeof( struct mlt_filter_s ) ); - this->child = child; - if ( mlt_service_init( service, this ) == 0 ) - { - mlt_properties properties = mlt_service_properties( service ); - - // Override the get_frame method - service->get_frame = filter_get_frame; - - // Default in, out, track properties - mlt_properties_set_position( properties, "in", 0 ); - mlt_properties_set_position( properties, "out", 0 ); - mlt_properties_set_int( properties, "track", 0 ); - - return 0; - } - return 1; -} - -/** Get the service associated to this filter -*/ - -mlt_service mlt_filter_service( mlt_filter this ) -{ - return &this->parent; -} - -mlt_properties mlt_filter_properties( mlt_filter this ) -{ - return mlt_service_properties( mlt_filter_service( this ) ); -} - -/** Connect this filter to a producers track. Note that a filter only operates - on a single track, and by default it operates on the entirety of that track. -*/ - -int mlt_filter_connect( mlt_filter this, mlt_service producer, int index ) -{ - int ret = mlt_service_connect_producer( &this->parent, producer, index ); - - // If the connection was successful, grab the producer, track and reset in/out - if ( ret == 0 ) - { - mlt_properties properties = mlt_service_properties( &this->parent ); - this->producer = producer; - mlt_properties_set_position( properties, "in", 0 ); - mlt_properties_set_position( properties, "out", 0 ); - mlt_properties_set_int( properties, "track", index ); - } - - return ret; -} - -/** Tune the in/out points. -*/ - -void mlt_filter_set_in_and_out( mlt_filter this, mlt_position in, mlt_position out ) -{ - mlt_properties properties = mlt_service_properties( &this->parent ); - mlt_properties_set_position( properties, "in", in ); - mlt_properties_set_position( properties, "out", out ); -} - -/** Return the track that this filter is operating on. -*/ - -int mlt_filter_get_track( mlt_filter this ) -{ - mlt_properties properties = mlt_service_properties( &this->parent ); - return mlt_properties_get_int( properties, "track" ); -} - -/** Get the in point. -*/ - -mlt_position mlt_filter_get_in( mlt_filter this ) -{ - mlt_properties properties = mlt_service_properties( &this->parent ); - return mlt_properties_get_position( properties, "in" ); -} - -/** Get the out point. -*/ - -mlt_position mlt_filter_get_out( mlt_filter this ) -{ - mlt_properties properties = mlt_service_properties( &this->parent ); - return mlt_properties_get_position( properties, "out" ); -} - -/** Process the frame. -*/ - -static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) -{ - if ( this->process == NULL ) - return frame; - else - return this->process( this, frame ); -} - -/** Get a frame from this filter. -*/ - -static int filter_get_frame( mlt_service service, mlt_frame_ptr frame, int index ) -{ - mlt_filter this = service->child; - - // Get coords in/out/track - int track = mlt_filter_get_track( this ); - int in = mlt_filter_get_in( this ); - int out = mlt_filter_get_out( this ); - - // If the frame request is for this filters track, we need to process it - if ( index == track ) - { - int ret = mlt_service_get_frame( this->producer, frame, index ); - if ( ret == 0 ) - { - if ( !mlt_frame_is_test_card( *frame ) ) - { - mlt_position position = mlt_frame_get_position( *frame ); - if ( position >= in && ( out == 0 || position < out ) ) - *frame = filter_process( this, *frame ); - } - return 0; - } - else - { - *frame = mlt_frame_init( ); - return 0; - } - } - else - { - return mlt_service_get_frame( this->producer, frame, index ); - } -} - -/** Close the filter. -*/ - -void mlt_filter_close( mlt_filter this ) -{ - if ( this->close != NULL ) - this->close( this ); - else - mlt_service_close( &this->parent ); -} - diff --git a/mlt/src/framework/mlt_filter.h b/mlt/src/framework/mlt_filter.h deleted file mode 100644 index edaf6f6..0000000 --- a/mlt/src/framework/mlt_filter.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * mlt_filter.h -- abstraction for all filter services - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_FILTER_H_ -#define _MLT_FILTER_H_ - -#include "mlt_service.h" - -/** The interface definition for all filters. -*/ - -struct mlt_filter_s -{ - // We're implementing service here - struct mlt_service_s parent; - - // public virtual - void ( *close )( mlt_filter ); - - // protected filter method - mlt_frame ( *process )( mlt_filter, mlt_frame ); - - // track and in/out points - mlt_service producer; - - // Protected - void *child; -}; - -/** Public final methods -*/ - -extern int mlt_filter_init( mlt_filter this, void *child ); -extern mlt_service mlt_filter_service( mlt_filter this ); -extern mlt_properties mlt_filter_properties( mlt_filter this ); -extern int mlt_filter_connect( mlt_filter this, mlt_service producer, int index ); -extern void mlt_filter_set_in_and_out( mlt_filter this, mlt_position in, mlt_position out ); -extern int mlt_filter_get_track( mlt_filter this ); -extern mlt_position mlt_filter_get_in( mlt_filter this ); -extern mlt_position mlt_filter_get_out( mlt_filter this ); -extern void mlt_filter_close( mlt_filter ); - -#endif diff --git a/mlt/src/framework/mlt_frame.c b/mlt/src/framework/mlt_frame.c deleted file mode 100644 index 3f583d9..0000000 --- a/mlt/src/framework/mlt_frame.c +++ /dev/null @@ -1,869 +0,0 @@ -/* - * mlt_frame.c -- interface for all frame classes - * 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 program 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. - * - * 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. - */ - -#include "config.h" -#include "mlt_frame.h" -#include -#include -#include - -typedef struct -{ - mlt_image_format vfmt; - int width; - int height; - uint8_t *image; - uint8_t *alpha; - mlt_audio_format afmt; - int16_t *audio; -} -frame_test; - -static frame_test test_card = { mlt_image_none, 0, 0, NULL, NULL, mlt_audio_none, NULL }; - -/** Constructor for a frame. -*/ - -mlt_frame mlt_frame_init( ) -{ - // Allocate a frame - mlt_frame this = calloc( sizeof( struct mlt_frame_s ), 1 ); - - if ( this != NULL ) - { - // Initialise the properties - mlt_properties properties = &this->parent; - mlt_properties_init( properties, this ); - - // Set default properties on the frame - mlt_properties_set_position( properties, "position", 0.0 ); - mlt_properties_set_data( properties, "image", NULL, 0, NULL, NULL ); - mlt_properties_set_int( properties, "width", 720 ); - mlt_properties_set_int( properties, "height", 576 ); - mlt_properties_set_double( properties, "aspect_ratio", 4.0 / 3.0 ); - mlt_properties_set_data( properties, "audio", NULL, 0, NULL, NULL ); - mlt_properties_set_data( properties, "alpha", NULL, 0, NULL, NULL ); - } - return this; -} - -/** Fetch the frames properties. -*/ - -mlt_properties mlt_frame_properties( mlt_frame this ) -{ - return &this->parent; -} - -/** Check if we have a way to derive something other than a test card. -*/ - -int mlt_frame_is_test_card( mlt_frame this ) -{ - return ( this->stack_get_image_size == 0 && mlt_properties_get_data( mlt_frame_properties( this ), "image", NULL ) == NULL ); -} - -/** Check if we have a way to derive something than test audio. -*/ - -int mlt_frame_is_test_audio( mlt_frame this ) -{ - return this->get_audio == NULL; -} - -/** Get the aspect ratio of the frame. -*/ - -double mlt_frame_get_aspect_ratio( mlt_frame this ) -{ - return mlt_properties_get_double( mlt_frame_properties( this ), "aspect_ratio" ); -} - -/** Set the aspect ratio of the frame. -*/ - -int mlt_frame_set_aspect_ratio( mlt_frame this, double value ) -{ - return mlt_properties_set_double( mlt_frame_properties( this ), "aspect_ratio", value ); -} - -/** Get the position of this frame. -*/ - -mlt_position mlt_frame_get_position( mlt_frame this ) -{ - return mlt_properties_get_position( mlt_frame_properties( this ), "position" ); -} - -/** Set the position of this frame. -*/ - -int mlt_frame_set_position( mlt_frame this, mlt_position value ) -{ - return mlt_properties_set_position( mlt_frame_properties( this ), "position", value ); -} - -/** Stack a get_image callback. -*/ - -int mlt_frame_push_get_image( mlt_frame this, mlt_get_image get_image ) -{ - int ret = this->stack_get_image_size >= 10; - if ( ret == 0 ) - this->stack_get_image[ this->stack_get_image_size ++ ] = get_image; - return ret; -} - -/** Pop a get_image callback. -*/ - -mlt_get_image mlt_frame_pop_get_image( mlt_frame this ) -{ - mlt_get_image result = NULL; - if ( this->stack_get_image_size > 0 ) - result = this->stack_get_image[ -- this->stack_get_image_size ]; - return result; -} - -/** Push a frame. -*/ - -int mlt_frame_push_frame( mlt_frame this, mlt_frame that ) -{ - int ret = this->stack_frame_size >= 10; - if ( ret == 0 ) - this->stack_frame[ this->stack_frame_size ++ ] = that; - return ret; -} - -/** Pop a frame. -*/ - -mlt_frame mlt_frame_pop_frame( mlt_frame this ) -{ - mlt_frame result = NULL; - if ( this->stack_frame_size > 0 ) - result = this->stack_frame[ -- this->stack_frame_size ]; - return result; -} - -int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable ) -{ - mlt_properties properties = mlt_frame_properties( this ); - mlt_get_image get_image = mlt_frame_pop_get_image( this ); - - if ( get_image != NULL ) - { - return get_image( this, buffer, format, width, height, writable ); - } - else if ( mlt_properties_get_data( properties, "image", NULL ) != NULL ) - { - *format = mlt_image_yuv422; - *buffer = mlt_properties_get_data( properties, "image", NULL ); - *width = mlt_properties_get_int( properties, "width" ); - *height = mlt_properties_get_int( properties, "height" ); - } - else - { - if ( test_card.vfmt != *format ) - { - uint8_t *p; - uint8_t *q; - - test_card.vfmt = *format; - test_card.width = *width == 0 ? 720 : *width; - test_card.height = *height == 0 ? 576 : *height; - - switch( *format ) - { - case mlt_image_none: - break; - case mlt_image_rgb24: - test_card.image = realloc( test_card.image, test_card.width * test_card.height * 3 ); - memset( test_card.image, 255, test_card.width * test_card.height * 3 ); - break; - case mlt_image_rgb24a: - test_card.image = realloc( test_card.image, test_card.width * test_card.height * 4 ); - memset( test_card.image, 255, test_card.width * test_card.height * 4 ); - break; - case mlt_image_yuv422: - test_card.image = realloc( test_card.image, test_card.width * test_card.height * 2 ); - p = test_card.image; - q = test_card.image + test_card.width * test_card.height * 2; - while ( p != q ) - { - *p ++ = 255; - *p ++ = 128; - } - break; - case mlt_image_yuv420p: - test_card.image = realloc( test_card.image, test_card.width * test_card.height * 3 / 2 ); - memset( test_card.image, 255, test_card.width * test_card.height * 3 / 2 ); - break; - } - } - - *width = test_card.width; - *height = test_card.height; - *buffer = test_card.image; - } - - return 0; -} - -uint8_t *mlt_frame_get_alpha_mask( mlt_frame this ) -{ - if ( this->get_alpha_mask != NULL ) - return this->get_alpha_mask( this ); - return test_card.alpha; -} - -int mlt_frame_get_audio( mlt_frame this, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples ) -{ - if ( this->get_audio != NULL ) - { - return this->get_audio( this, buffer, format, frequency, channels, samples ); - } - else - { - if ( *samples <= 0 ) - *samples = 1920; - if ( *channels <= 0 ) - *channels = 2; - if ( *frequency <= 0 ) - *frequency = 48000; - if ( test_card.audio == NULL || test_card.afmt != *format ) - { - test_card.afmt = *format; - test_card.audio = realloc( test_card.audio, *samples * *channels * sizeof( int16_t ) ); - memset( test_card.audio, 0, *samples * *channels * sizeof( int16_t ) ); - } - - *buffer = test_card.audio; - } - return 0; -} - -void mlt_frame_close( mlt_frame this ) -{ - mlt_properties_close( &this->parent ); - free( this ); -} - -/***** convenience functions *****/ -#define RGB2YUV(r, g, b, y, u, v)\ - y = (306*r + 601*g + 117*b) >> 10;\ - u = ((-172*r - 340*g + 512*b) >> 10) + 128;\ - v = ((512*r - 429*g - 83*b) >> 10) + 128;\ - y = y < 0 ? 0 : y;\ - u = u < 0 ? 0 : u;\ - v = v < 0 ? 0 : v;\ - y = y > 255 ? 255 : y;\ - u = u > 255 ? 255 : u;\ - v = v > 255 ? 255 : v - -int mlt_convert_rgb24a_to_yuv422( uint8_t *rgba, int width, int height, int stride, uint8_t *yuv, uint8_t *alpha ) -{ - int ret = 0; - register int y0, y1, u0, u1, v0, v1; - register int r, g, b; - register uint8_t *d = yuv; - register int i, j; - - for ( i = 0; i < height; i++ ) - { - register uint8_t *s = rgba + ( stride * i ); - for ( j = 0; j < ( width / 2 ); j++ ) - { - r = *s++; - g = *s++; - b = *s++; - *alpha++ = *s++; - RGB2YUV (r, g, b, y0, u0 , v0); - r = *s++; - g = *s++; - b = *s++; - *alpha++ = *s++; - RGB2YUV (r, g, b, y1, u1 , v1); - *d++ = y0; - *d++ = (u0+u1) >> 1; - *d++ = y1; - *d++ = (v0+v1) >> 1; - } - if ( width % 2 ) - { - r = *s++; - g = *s++; - b = *s++; - *alpha++ = *s++; - RGB2YUV (r, g, b, y0, u0 , v0); - *d++ = y0; - *d++ = u0; - } - } - return ret; -} - -int mlt_convert_rgb24_to_yuv422( uint8_t *rgb, int width, int height, int stride, uint8_t *yuv ) -{ - int ret = 0; - register int y0, y1, u0, u1, v0, v1; - register int r, g, b; - register uint8_t *d = yuv; - register int i, j; - - for ( i = 0; i < height; i++ ) - { - register uint8_t *s = rgb + ( stride * i ); - for ( j = 0; j < ( width / 2 ); j++ ) - { - r = *s++; - g = *s++; - b = *s++; - RGB2YUV (r, g, b, y0, u0 , v0); - r = *s++; - g = *s++; - b = *s++; - RGB2YUV (r, g, b, y1, u1 , v1); - *d++ = y0; - *d++ = (u0+u1) >> 1; - *d++ = y1; - *d++ = (v0+v1) >> 1; - } - if ( width % 2 ) - { - r = *s++; - g = *s++; - b = *s++; - RGB2YUV (r, g, b, y0, u0 , v0); - *d++ = y0; - *d++ = u0; - } - } - return ret; -} - -int mlt_convert_yuv420p_to_yuv422( uint8_t *yuv420p, int width, int height, int stride, uint8_t *yuv ) -{ - int ret = 0; - register int i, j; - - int half = width >> 1; - - uint8_t *Y = yuv420p; - uint8_t *U = Y + width * height; - uint8_t *V = U + width * height / 4; - - register uint8_t *d = yuv; - - for ( i = 0; i < height; i++ ) - { - register uint8_t *u = U + ( i / 2 ) * ( half ); - register uint8_t *v = V + ( i / 2 ) * ( half ); - - for ( j = 0; j < half; j++ ) - { - *d ++ = *Y ++; - *d ++ = *u ++; - *d ++ = *Y ++; - *d ++ = *v ++; - } - } - return ret; -} - -int mlt_frame_composite_yuv( mlt_frame this, mlt_frame that, int x, int y, float weight ) -{ - int ret = 0; - int width_src = 0, height_src = 0; - int width_dest = 0, height_dest = 0; - mlt_image_format format_src = mlt_image_yuv422, format_dest = mlt_image_yuv422; - uint8_t *p_src, *p_dest; - int i, j; - int stride_src; - int stride_dest; - int x_src = 0, y_src = 0; - - // optimization point - no work to do - if ( ( x < 0 && -x >= width_src ) || ( y < 0 && -y >= height_src ) ) - return ret; - - format_src = mlt_image_yuv422; - format_dest = mlt_image_yuv422; - - //fprintf( stderr, "call get_image on frame a\n"), fflush( stderr ); - mlt_frame_get_image( this, &p_dest, &format_dest, &width_dest, &height_dest, 1 /* writable */ ); - //fprintf( stderr, "call get_image on frame b\n"), fflush( stderr ); - mlt_frame_get_image( that, &p_src, &format_src, &width_src, &height_src, 0 /* writable */ ); - - //fprintf( stderr, "mlt_frame_composite_yuv %dx%d -> %dx%d\n", width_src, height_src, width_dest, height_dest ); - //fflush(stderr); - //return ret; - stride_src = width_src * 2; - stride_dest = width_dest * 2; - - // crop overlay off the left edge of frame - if ( x < 0 ) - { - x_src = -x; - width_src -= x_src; - x = 0; - } - - // crop overlay beyond right edge of frame - else if ( x + width_src > width_dest ) - width_src = width_dest - x; - - // crop overlay off the top edge of the frame - if ( y < 0 ) - { - y_src = -y; - height_src -= y_src; - } - // crop overlay below bottom edge of frame - else if ( y + height_src > height_dest ) - height_src = height_dest - y; - - // offset pointer into overlay buffer based on cropping - p_src += x_src * 2 + y_src * stride_src; - - // offset pointer into frame buffer based upon positive, even coordinates only! -// if ( interlaced && y % 2 ) -// ++y; - p_dest += ( x < 0 ? 0 : x ) * 2 + ( y < 0 ? 0 : y ) * stride_dest; - - // Get the alpha channel of the overlay - uint8_t *p_alpha = mlt_frame_get_alpha_mask( that ); - - // offset pointer into alpha channel based upon cropping - if ( p_alpha ) - p_alpha += x_src + y_src * stride_src / 2; - - uint8_t *p = p_src; - uint8_t *q = p_dest; - uint8_t *o = p_dest; - uint8_t *z = p_alpha; - - uint8_t Y; - uint8_t UV; - uint8_t a; - float value; - - // now do the compositing only to cropped extents - for ( i = 0; i < height_src; i++ ) - { - p = p_src; - q = p_dest; - o = p_dest; - z = p_alpha; - - for ( j = 0; j < width_src; j ++ ) - { - Y = *p ++; - UV = *p ++; - a = ( z == NULL ) ? 255 : *z ++; - value = ( weight * ( float ) a / 255.0 ); - *o ++ = (uint8_t)( Y * value + *q++ * ( 1 - value ) ); - *o ++ = (uint8_t)( UV * value + *q++ * ( 1 - value ) ); - } - - p_src += stride_src; - p_dest += stride_dest; - if ( p_alpha ) - p_alpha += stride_src / 2; - } - - return ret; -} - -void *memfill( void *dst, void *src, int l, int elements ) -{ - int i = 0; - if ( l == 2 ) - { - uint8_t *p = dst; - uint8_t *src1 = src; - uint8_t *src2 = src + 1; - for ( i = 0; i < elements; i ++ ) - { - *p ++ = *src1; - *p ++ = *src2; - } - dst = p; - } - else - { - for ( i = 0; i < elements; i ++ ) - dst = memcpy( dst, src, l ) + l; - } - return dst; -} - -void mlt_resize_yuv422( uint8_t *output, int owidth, int oheight, uint8_t *input, int iwidth, int iheight ) -{ - // Calculate strides - int istride = iwidth * 2; - int ostride = owidth * 2; - - iwidth = iwidth - ( iwidth % 4 ); - owidth = owidth - ( owidth % 4 ); - iheight = iheight - ( iheight % 2 ); - oheight = oheight - ( oheight % 2 ); - - // Coordinates (0,0 is middle of output) - int y; - - // Calculate ranges - int out_x_range = owidth / 2; - int out_y_range = oheight / 2; - int in_x_range = iwidth / 2 < out_x_range ? iwidth / 2 : out_x_range; - int in_y_range = iheight / 2 < out_y_range ? iheight / 2 : out_y_range; - - // Output pointers - uint8_t *out_line = output; - uint8_t *out_ptr = out_line; - - // Calculate a middle and possibly invalid pointer in the input - uint8_t *in_middle = input + istride * ( iheight / 2 ) + ( iwidth / 2 ) * 2; - int in_line = - in_y_range * istride - in_x_range * 2; - - uint8_t black[ 2 ] = { 16, 128 }; - - // Loop for the entirety of our output height. - for ( y = - out_y_range; y < out_y_range ; y ++ ) - { - // Start at the beginning of the line - out_ptr = out_line; - - if ( abs( y ) < iheight / 2 ) - { - // Fill the outer part with black - out_ptr = memfill( out_ptr, black, 2, out_x_range - in_x_range ); - - // We're in the input range for this row. - memcpy( out_ptr, in_middle + in_line, 2 * iwidth ); - out_ptr += 2 * iwidth; - - // Fill the outer part with black - out_ptr = memfill( out_ptr, black, 2, out_x_range - in_x_range ); - - // Move to next input line - in_line += istride; - } - else - { - // Fill whole line with black - out_ptr = memfill( out_ptr, black, 2, owidth ); - } - - // Move to next output line - out_line += ostride; - } -} - -/** A resizing function for yuv422 frames - this does not rescale, but simply - resizes. It assumes yuv422 images available on the frame so use with care. -*/ - -uint8_t *mlt_frame_resize_yuv422( mlt_frame this, int owidth, int oheight ) -{ - // Get properties - mlt_properties properties = mlt_frame_properties( this ); - - // Get the input image, width and height - uint8_t *input = mlt_properties_get_data( properties, "image", NULL ); - int iwidth = mlt_properties_get_int( properties, "width" ); - int iheight = mlt_properties_get_int( properties, "height" ); - - // If width and height are correct, don't do anything - if ( iwidth != owidth || iheight != oheight ) - { - // Create the output image - uint8_t *output = malloc( owidth * oheight * 2 ); - - // Call the generic resize - mlt_resize_yuv422( output, owidth, oheight, input, iwidth, iheight ); - - // Now update the frame - mlt_properties_set_data( properties, "image", output, owidth * oheight * 2, free, NULL ); - mlt_properties_set_int( properties, "width", owidth ); - mlt_properties_set_int( properties, "height", oheight ); - - // Return the output - return output; - } - - // No change, return input - return input; -} - -/** A rescaling function for yuv422 frames - low quality, and provided for testing - only. It assumes yuv422 images available on the frame so use with care. -*/ - -uint8_t *mlt_frame_rescale_yuv422( mlt_frame this, int owidth, int oheight ) -{ - // Get properties - mlt_properties properties = mlt_frame_properties( this ); - - // Get the input image, width and height - uint8_t *input = mlt_properties_get_data( properties, "image", NULL ); - int iwidth = mlt_properties_get_int( properties, "width" ); - int iheight = mlt_properties_get_int( properties, "height" ); - - // If width and height are correct, don't do anything - if ( iwidth != owidth || iheight != oheight ) - { - // Create the output image - uint8_t *output = malloc( owidth * oheight * 2 ); - - // Calculate strides - int istride = iwidth * 2; - int ostride = owidth * 2; - - iwidth = iwidth - ( iwidth % 4 ); - - // Coordinates (0,0 is middle of output) - int y, x; - - // Derived coordinates - int dy, dx; - - // Calculate ranges - int out_x_range = owidth / 2; - int out_y_range = oheight / 2; - int in_x_range = iwidth / 2; - int in_y_range = iheight / 2; - - // Output pointers - uint8_t *out_line = output; - uint8_t *out_ptr; - - // Calculate a middle pointer - uint8_t *in_middle = input + istride * in_y_range + in_x_range * 2; - uint8_t *in_line; - uint8_t *in_ptr; - - // Generate the affine transform scaling values - float scale_width = ( float )iwidth / ( float )owidth; - float scale_height = ( float )iheight / ( float )oheight; - - // Loop for the entirety of our output height. - for ( y = - out_y_range; y < out_y_range ; y ++ ) - { - // Calculate the derived y value - dy = scale_height * y; - - // Start at the beginning of the line - out_ptr = out_line; - - // Pointer to the middle of the input line - in_line = in_middle + dy * istride; - - // Loop for the entirety of our output row. - for ( x = - out_x_range; x < out_x_range; x += 1 ) - { - // Calculated the derived x - dx = scale_width * x; - - // Check if x and y are in the valid input range. - if ( abs( dx ) < in_x_range && abs( dy ) < in_y_range ) - { - // We're in the input range for this row. - in_ptr = in_line + ( dx >> 1 ) * 4 + 2 * ( x & 1 ); - *out_ptr ++ = *in_ptr ++; - *out_ptr ++ = *in_ptr ++; - } - else - { - // We're not in the input range for this row. - *out_ptr ++ = 16; - *out_ptr ++ = 128; - } - } - - // Move to next output line - out_line += ostride; - } - - // Now update the frame - mlt_properties_set_data( properties, "image", output, owidth * oheight * 2, free, NULL ); - mlt_properties_set_int( properties, "width", owidth ); - mlt_properties_set_int( properties, "height", oheight ); - - // Return the output - return output; - } - - // No change, return input - return input; -} - -int mlt_frame_mix_audio( mlt_frame this, mlt_frame that, float weight, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples ) -{ - int ret = 0; - int16_t *p_src, *p_dest; - int16_t *src, *dest; - //static int16_t *extra_src = NULL, *extra_dest = NULL; - static int extra_src_samples = 0, extra_dest_samples = 0; - int frequency_src = 0, frequency_dest = 0; - int channels_src = 0, channels_dest = 0; - int samples_src = 0, samples_dest = 0; - int i, j; - - mlt_frame_get_audio( this, &p_dest, format, &frequency_dest, &channels_dest, &samples_dest ); - //fprintf( stderr, "frame dest samples %d channels %d position %f\n", samples_dest, channels_dest, mlt_properties_get_position( mlt_frame_properties( this ), "position" ) ); - mlt_frame_get_audio( that, &p_src, format, &frequency_src, &channels_src, &samples_src ); - //fprintf( stderr, "frame src samples %d channels %d\n", samples_src, channels_src ); - if ( channels_src > 6 ) - channels_src = 0; - if ( channels_dest > 6 ) - channels_dest = 0; - if ( samples_src > 4000 ) - samples_src = 0; - if ( samples_dest > 4000 ) - samples_dest = 0; - -#if 0 - // Append new samples to leftovers - if ( extra_dest_samples > 0 ) - { - fprintf( stderr, "prepending %d samples to dest\n", extra_dest_samples ); - dest = realloc( extra_dest, ( samples_dest + extra_dest_samples ) * 2 * channels_dest ); - memcpy( &extra_dest[ extra_dest_samples * channels_dest ], p_dest, samples_dest * 2 * channels_dest ); - } - else - dest = p_dest; - if ( extra_src_samples > 0 ) - { - fprintf( stderr, "prepending %d samples to src\n", extra_src_samples ); - src = realloc( extra_src, ( samples_src + extra_src_samples ) * 2 * channels_src ); - memcpy( &extra_src[ extra_src_samples * channels_src ], p_src, samples_src * 2 * channels_src ); - } - else - src = p_src; -#else - src = p_src; - dest = p_dest; -#endif - - // determine number of samples to process - if ( samples_src + extra_src_samples < samples_dest + extra_dest_samples ) - *samples = samples_src + extra_src_samples; - else if ( samples_dest + extra_dest_samples < samples_src + extra_src_samples ) - *samples = samples_dest + extra_dest_samples; - - *channels = channels_src < channels_dest ? channels_src : channels_dest; - *buffer = p_dest; - - // Mixdown - for ( i = 0; i < *samples; i++ ) - { - for ( j = 0; j < *channels; j++ ) - { - double d = (double) dest[ i * channels_dest + j ]; - double s = (double) src[ i * channels_src + j ]; - dest[ i * channels_dest + j ] = s * weight + d * ( 1.0 - weight ); - } - } - - // We have to copy --sigh - if ( dest != p_dest ) - memcpy( p_dest, dest, *samples * 2 * *channels ); - -#if 0 - // Store the leftovers - if ( samples_src + extra_src_samples < samples_dest + extra_dest_samples ) - { - extra_dest_samples = ( samples_dest + extra_dest_samples ) - ( samples_src + extra_src_samples ); - size_t size = extra_dest_samples * 2 * channels_dest; - fprintf( stderr, "storing %d samples from dest\n", extra_dest_samples ); - if ( extra_dest ) - free( extra_dest ); - extra_dest = malloc( size ); - if ( extra_dest ) - memcpy( extra_dest, &p_dest[ ( samples_dest - extra_dest_samples - 1 ) * channels_dest ], size ); - else - extra_dest_samples = 0; - } - else if ( samples_dest + extra_dest_samples < samples_src + extra_src_samples ) - { - extra_src_samples = ( samples_src + extra_src_samples ) - ( samples_dest + extra_dest_samples ); - size_t size = extra_src_samples * 2 * channels_src; - fprintf( stderr, "storing %d samples from src\n", extra_dest_samples ); - if ( extra_src ) - free( extra_src ); - extra_src = malloc( size ); - if ( extra_src ) - memcpy( extra_src, &p_src[ ( samples_src - extra_src_samples - 1 ) * channels_src ], size ); - else - extra_src_samples = 0; - } -#endif - - return ret; -} - -int mlt_sample_calculator( float fps, int frequency, int64_t position ) -{ - int samples = 0; - - if ( fps > 29 && fps <= 30 ) - { - samples = frequency / 30; - - switch ( frequency ) - { - case 48000: - if ( position % 5 != 0 ) - samples += 2; - break; - case 44100: - if ( position % 300 == 0 ) - samples = 1471; - else if ( position % 30 == 0 ) - samples = 1470; - else if ( position % 2 == 0 ) - samples = 1472; - else - samples = 1471; - break; - case 32000: - if ( position % 30 == 0 ) - samples = 1068; - else if ( position % 29 == 0 ) - samples = 1067; - else if ( position % 4 == 2 ) - samples = 1067; - else - samples = 1068; - break; - default: - samples = 0; - } - } - else if ( fps != 0 ) - { - samples = frequency / fps; - } - - return samples; -} - diff --git a/mlt/src/framework/mlt_frame.h b/mlt/src/framework/mlt_frame.h deleted file mode 100644 index 5ece49c..0000000 --- a/mlt/src/framework/mlt_frame.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * mlt_frame.h -- interface for all frame classes - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_FRAME_H_ -#define _MLT_FRAME_H_ - -#include "mlt_properties.h" - -typedef enum -{ - mlt_image_none = 0, - mlt_image_rgb24, - mlt_image_rgb24a, - mlt_image_yuv422, - mlt_image_yuv420p -} -mlt_image_format; - -typedef enum -{ - mlt_video_standard_pal = 0, - mlt_video_standard_ntsc -} -mlt_video_standard; - -typedef enum -{ - mlt_audio_none = 0, - mlt_audio_pcm -} -mlt_audio_format; - -typedef int ( *mlt_get_image )( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable ); - -struct mlt_frame_s -{ - // We're extending properties here - struct mlt_properties_s parent; - - // Virtual methods - int ( *get_audio )( mlt_frame this, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples ); - uint8_t * ( *get_alpha_mask )( mlt_frame this ); - - // Private properties - mlt_get_image stack_get_image[ 10 ]; - int stack_get_image_size; - mlt_frame stack_frame[ 10 ]; - int stack_frame_size; -}; - -extern mlt_frame mlt_frame_init( ); -extern mlt_properties mlt_frame_properties( mlt_frame this ); -extern int mlt_frame_is_test_card( mlt_frame this ); -extern int mlt_frame_is_test_audio( mlt_frame this ); -extern double mlt_frame_get_aspect_ratio( mlt_frame this ); -extern int mlt_frame_set_aspect_ratio( mlt_frame this, double value ); -extern mlt_position mlt_frame_get_position( mlt_frame this ); -extern int mlt_frame_set_position( mlt_frame this, mlt_position value ); - -extern int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable ); -extern uint8_t *mlt_frame_get_alpha_mask( mlt_frame this ); -extern int mlt_frame_get_audio( mlt_frame this, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples ); - -extern int mlt_frame_push_get_image( mlt_frame this, mlt_get_image get_image ); -extern mlt_get_image mlt_frame_pop_get_image( mlt_frame this ); -extern int mlt_frame_push_frame( mlt_frame this, mlt_frame that ); -extern mlt_frame mlt_frame_pop_frame( mlt_frame this ); -extern void mlt_frame_close( mlt_frame this ); - -/* convenience functions */ -extern int mlt_convert_rgb24a_to_yuv422( uint8_t *rgba, int width, int height, int stride, uint8_t *yuv, uint8_t *alpha ); -extern int mlt_convert_rgb24_to_yuv422( uint8_t *rgb, int width, int height, int stride, uint8_t *yuv ); -extern int mlt_convert_yuv420p_to_yuv422( uint8_t *yuv420p, int width, int height, int stride, uint8_t *yuv ); -extern int mlt_frame_composite_yuv( mlt_frame this, mlt_frame that, int x, int y, float weight ); -extern uint8_t *mlt_frame_resize_yuv422( mlt_frame this, int owidth, int oheight ); -extern uint8_t *mlt_frame_rescale_yuv422( mlt_frame this, int owidth, int oheight ); -extern void mlt_resize_yuv422( uint8_t *output, int owidth, int oheight, uint8_t *input, int iwidth, int iheight ); -extern int mlt_frame_mix_audio( mlt_frame this, mlt_frame that, float weight, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples ); -extern int mlt_sample_calculator( float fps, int frequency, int64_t position ); - -#endif - diff --git a/mlt/src/framework/mlt_manager.h b/mlt/src/framework/mlt_manager.h deleted file mode 100644 index 1567e64..0000000 --- a/mlt/src/framework/mlt_manager.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * mlt_manager.h -- manager service class - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_MANAGER_H_ -#define _MLT_MANAGER_H_ - -mlt_producer mlt_manager_init( char **config ); - -#endif diff --git a/mlt/src/framework/mlt_multitrack.c b/mlt/src/framework/mlt_multitrack.c deleted file mode 100644 index 2faaf69..0000000 --- a/mlt/src/framework/mlt_multitrack.c +++ /dev/null @@ -1,376 +0,0 @@ -/* - * mlt_multitrack.c -- multitrack service class - * 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 program 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. - * - * 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. - */ - -#include "config.h" - -#include "mlt_multitrack.h" -#include "mlt_playlist.h" -#include "mlt_frame.h" - -#include -#include - -/** Private definition. -*/ - -struct mlt_multitrack_s -{ - // We're extending producer here - struct mlt_producer_s parent; - mlt_producer *list; - int size; - int count; -}; - -/** Forward reference. -*/ - -static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index ); - -/** Constructor. -*/ - -mlt_multitrack mlt_multitrack_init( ) -{ - // Allocate the multitrack object - mlt_multitrack this = calloc( sizeof( struct mlt_multitrack_s ), 1 ); - - if ( this != NULL ) - { - mlt_producer producer = &this->parent; - if ( mlt_producer_init( producer, this ) == 0 ) - { - mlt_properties properties = mlt_multitrack_properties( this ); - producer->get_frame = producer_get_frame; - mlt_properties_set_data( properties, "multitrack", this, 0, NULL, NULL ); - mlt_properties_set( properties, "log_id", "multitrack" ); - mlt_properties_set( properties, "resource", "" ); - } - else - { - free( this ); - this = NULL; - } - } - - return this; -} - -/** Get the producer associated to this multitrack. -*/ - -mlt_producer mlt_multitrack_producer( mlt_multitrack this ) -{ - return &this->parent; -} - -/** Get the service associated this multitrack. -*/ - -mlt_service mlt_multitrack_service( mlt_multitrack this ) -{ - return mlt_producer_service( mlt_multitrack_producer( this ) ); -} - -/** Get the properties associated this multitrack. -*/ - -mlt_properties mlt_multitrack_properties( mlt_multitrack this ) -{ - return mlt_service_properties( mlt_multitrack_service( this ) ); -} - -/** Initialise position related information. -*/ - -void mlt_multitrack_refresh( mlt_multitrack this ) -{ - int i = 0; - - // Obtain the properties of this multitrack - mlt_properties properties = mlt_multitrack_properties( this ); - - // We need to ensure that the multitrack reports the longest track as its length - mlt_position length = 0; - - // We need to ensure that fps are the same on all services - double fps = 0; - - // Obtain stats on all connected services - for ( i = 0; i < this->count; i ++ ) - { - // Get the producer from this index - mlt_producer producer = this->list[ i ]; - - // If it's allocated then, update our stats - if ( producer != NULL ) - { - // If we have more than 1 track, we must be in continue mode - if ( this->count > 1 ) - mlt_properties_set( mlt_producer_properties( producer ), "eof", "continue" ); - - // Determine the longest length - length = mlt_producer_get_playtime( producer ) > length ? mlt_producer_get_playtime( producer ) : length; - - // Handle fps - if ( fps == 0 ) - { - // This is the first producer, so it controls the fps - fps = mlt_producer_get_fps( producer ); - } - else if ( fps != mlt_producer_get_fps( producer ) ) - { - // Generate a warning for now - the following attempt to fix may fail - fprintf( stderr, "Warning: fps mismatch on track %d\n", i ); - - // It should be safe to impose fps on an image producer, but not necessarily safe for video - mlt_properties_set_double( mlt_producer_properties( producer ), "fps", fps ); - } - } - } - - // Update multitrack properties now - we'll not destroy the in point here - mlt_properties_set_position( properties, "length", length ); - mlt_properties_set_position( properties, "out", length - 1 ); - mlt_properties_set_double( properties, "fps", fps ); -} - -/** Connect a producer to a given track. - - Note that any producer can be connected here, but see special case treatment - of playlist in clip point determination below. -*/ - -int mlt_multitrack_connect( mlt_multitrack this, mlt_producer producer, int track ) -{ - // Connect to the producer to ourselves at the specified track - int result = mlt_service_connect_producer( mlt_multitrack_service( this ), mlt_producer_service( producer ), track ); - - if ( result == 0 ) - { - // Resize the producer list if need be - if ( track >= this->size ) - { - int i; - this->list = realloc( this->list, ( track + 10 ) * sizeof( mlt_producer ) ); - for ( i = this->size; i < track + 10; i ++ ) - this->list[ i ] = NULL; - this->size = track + 10; - } - - // Assign the track in our list here - this->list[ track ] = producer; - - // Increment the track count if need be - if ( track >= this->count ) - this->count = track + 1; - - // Refresh our stats - mlt_multitrack_refresh( this ); - } - - return result; -} - -/** Get the number of tracks. -*/ - -int mlt_multitrack_count( mlt_multitrack this ) -{ - return this->count; -} - -/** Get an individual track as a producer. -*/ - -mlt_producer mlt_multitrack_track( mlt_multitrack this, int track ) -{ - mlt_producer producer = NULL; - - if ( this->list != NULL && track < this->count ) - producer = this->list[ track ]; - - return producer; -} - - -/** Determine the clip point. - - Special case here: a 'producer' has no concept of multiple clips - only the - playlist and multitrack producers have clip functionality. Further to that a - multitrack determines clip information from any connected tracks that happen - to be playlists. - - Additionally, it must locate clips in the correct order, for example, consider - the following track arrangement: - - playlist1 |0.0 |b0.0 |0.1 |0.1 |0.2 | - playlist2 |b1.0 |1.0 |b1.1 |1.1 | - - Note - b clips represent blanks. They are also reported as clip positions. - - When extracting clip positions from these playlists, we should get a sequence of: - - 0.0, 1.0, b0.0, 0.1, b1.1, 1.1, 0.1, 0.2, [out of playlist2], [out of playlist1] -*/ - -mlt_position mlt_multitrack_clip( mlt_multitrack this, mlt_whence whence, int index ) -{ - int first = 1; - mlt_position position = 0; - int i = 0; - - // Loop through each of the tracks - for ( i = 0; i < this->count; i ++ ) - { - // Get the producer for this track - mlt_producer producer = this->list[ i ]; - - // If it's assigned... - if ( producer != NULL ) - { - // Get the properties of this producer - mlt_properties properties = mlt_producer_properties( producer ); - - // Determine if it's a playlist - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - - // We only consider playlists - if ( playlist != NULL ) - { - // Locate the smallest position - if ( first ) - { - // First position found - position = mlt_playlist_clip( playlist, whence, index ); - - // We're no longer first - first = 0; - } - else - { - // Obtain the clip position in this playlist - //mlt_position position2 = mlt_playlist_clip( playlist, whence, index ); - - // If this position is prior to the first, then use it - //if ( position2 < position ) - //position = position2; - } - } - else - { - fprintf( stderr, "track %d isn't a playlist\n", index ); - } - } - } - - return position; -} - -/** Get frame method. - - Special case here: The multitrack must be used in a conjunction with a downstream - tractor-type service, ie: - - Producer1 \ - Producer2 - multitrack - { filters/transitions } - tractor - consumer - Producer3 / - - The get_frame of a tractor pulls frames from it's connected service on all tracks and - will terminate as soon as it receives a test card with a last_track property. The - important case here is that the mulitrack does not move to the next frame until all - tracks have been pulled. - - Reasoning: In order to seek on a network such as above, the multitrack needs to ensure - that all producers are positioned on the same frame. It uses the 'last track' logic - to determine when to move to the next frame. - - Flaw: if a transition is configured to read from a b-track which happens to trigger - the last frame logic (ie: it's configured incorrectly), then things are going to go - out of sync. - - See playlist logic too. -*/ - -static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index ) -{ - // Get the mutiltrack object - mlt_multitrack this = parent->child; - - // Check if we have a track for this index - if ( index < this->count && this->list[ index ] != NULL ) - { - // Get the producer for this track - mlt_producer producer = this->list[ index ]; - - // Obtain the current position - mlt_position position = mlt_producer_frame( parent ); - - // Make sure we're at the same point - mlt_producer_seek( producer, position ); - - // Get the frame from the producer - mlt_service_get_frame( mlt_producer_service( producer ), frame, 0 ); - - // Indicate speed of this producer - mlt_properties producer_properties = mlt_producer_properties( parent ); - double speed = mlt_properties_get_double( producer_properties, "speed" ); - mlt_properties properties = mlt_frame_properties( *frame ); - mlt_properties_set_double( properties, "speed", speed ); - } - else - { - // Generate a test frame - *frame = mlt_frame_init( ); - - // Update position on the frame we're creating - mlt_frame_set_position( *frame, mlt_producer_position( parent ) ); - - // Move on to the next frame - if ( index >= this->count ) - { - // Let tractor know if we've reached the end - mlt_properties_set_int( mlt_frame_properties( *frame ), "last_track", 1 ); - - // Move to the next frame - mlt_producer_prepare_next( parent ); - } - - // Refresh our stats - mlt_multitrack_refresh( this ); - } - - return 0; -} - -/** Close this instance. -*/ - -void mlt_multitrack_close( mlt_multitrack this ) -{ - // Close the producer - mlt_producer_close( &this->parent ); - - // Free the list - free( this->list ); - - // Free the object - free( this ); -} diff --git a/mlt/src/framework/mlt_multitrack.h b/mlt/src/framework/mlt_multitrack.h deleted file mode 100644 index c409752..0000000 --- a/mlt/src/framework/mlt_multitrack.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * mlt_multitrack.h -- multitrack service class - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_MULITRACK_H_ -#define _MLT_MULITRACK_H_ - -#include "mlt_producer.h" - -/** Public final methods -*/ - -extern mlt_multitrack mlt_multitrack_init( ); -extern mlt_producer mlt_multitrack_producer( mlt_multitrack this ); -extern mlt_service mlt_multitrack_service( mlt_multitrack this ); -extern mlt_properties mlt_multitrack_properties( mlt_multitrack this ); -extern int mlt_multitrack_connect( mlt_multitrack this, mlt_producer producer, int track ); -extern mlt_position mlt_multitrack_clip( mlt_multitrack this, mlt_whence whence, int index ); -extern void mlt_multitrack_close( mlt_multitrack this ); -extern int mlt_multitrack_count( mlt_multitrack this ); -extern mlt_producer mlt_multitrack_track( mlt_multitrack this, int track ); - -#endif - diff --git a/mlt/src/framework/mlt_playlist.c b/mlt/src/framework/mlt_playlist.c deleted file mode 100644 index 7399d51..0000000 --- a/mlt/src/framework/mlt_playlist.c +++ /dev/null @@ -1,646 +0,0 @@ -/* - * mlt_playlist.c -- playlist service class - * 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 program 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. - * - * 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. - */ - -#include "config.h" - -#include "mlt_playlist.h" -#include "mlt_frame.h" - -#include -#include -#include - -/** Virtual playlist entry. -*/ - -typedef struct -{ - mlt_producer producer; - mlt_position frame_in; - mlt_position frame_out; - mlt_position frame_count; -} -playlist_entry; - -/** Private definition. -*/ - -struct mlt_playlist_s -{ - struct mlt_producer_s parent; - struct mlt_producer_s blank; - - int size; - int count; - playlist_entry **list; -}; - -/** Forward declarations -*/ - -static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index ); - -/** Constructor. -*/ - -mlt_playlist mlt_playlist_init( ) -{ - mlt_playlist this = calloc( sizeof( struct mlt_playlist_s ), 1 ); - if ( this != NULL ) - { - mlt_producer producer = &this->parent; - - // Construct the producer - mlt_producer_init( producer, this ); - - // Override the producer get_frame - producer->get_frame = producer_get_frame; - - // Initialise blank - mlt_producer_init( &this->blank, NULL ); - mlt_properties_set( mlt_producer_properties( &this->blank ), "mlt_service", "blank" ); - mlt_properties_set( mlt_producer_properties( &this->blank ), "resource", "blank" ); - - // Indicate that this producer is a playlist - mlt_properties_set_data( mlt_playlist_properties( this ), "playlist", this, 0, NULL, NULL ); - - // Specify the eof condition - mlt_properties_set( mlt_playlist_properties( this ), "eof", "pause" ); - mlt_properties_set( mlt_playlist_properties( this ), "resource", "" ); - } - - return this; -} - -/** Get the producer associated to this playlist. -*/ - -mlt_producer mlt_playlist_producer( mlt_playlist this ) -{ - return &this->parent; -} - -/** Get the service associated to this playlist. -*/ - -mlt_service mlt_playlist_service( mlt_playlist this ) -{ - return mlt_producer_service( &this->parent ); -} - -/** Get the propertues associated to this playlist. -*/ - -mlt_properties mlt_playlist_properties( mlt_playlist this ) -{ - return mlt_producer_properties( &this->parent ); -} - -/** Refresh the playlist after a clip has been changed. -*/ - -static int mlt_playlist_virtual_refresh( mlt_playlist this ) -{ - int i = 0; - - // Get the fps of the first producer - double fps = mlt_properties_get_double( mlt_playlist_properties( this ), "first_fps" ); - mlt_position frame_count = 0; - - for ( i = 0; i < this->count; i ++ ) - { - // Get the producer - mlt_producer producer = this->list[ i ]->producer; - - // If fps is 0 - if ( fps == 0 ) - { - // Inherit it from the producer - fps = mlt_producer_get_fps( producer ); - } - else if ( fps != mlt_properties_get_double( mlt_producer_properties( producer ), "fps" ) ) - { - // Generate a warning for now - the following attempt to fix may fail - fprintf( stderr, "Warning: fps mismatch on playlist producer %d\n", this->count ); - - // It should be safe to impose fps on an image producer, but not necessarily safe for video - mlt_properties_set_double( mlt_producer_properties( producer ), "fps", fps ); - } - - // Update the frame_count for this clip - frame_count += this->list[ i ]->frame_count; - } - - // Refresh all properties - mlt_properties_set_double( mlt_playlist_properties( this ), "first_fps", fps ); - mlt_properties_set_double( mlt_playlist_properties( this ), "fps", fps == 0 ? 25 : fps ); - mlt_properties_set_position( mlt_playlist_properties( this ), "length", frame_count ); - mlt_properties_set_position( mlt_playlist_properties( this ), "out", frame_count - 1 ); - - return 0; -} - -/** Append to the virtual playlist. -*/ - -static int mlt_playlist_virtual_append( mlt_playlist this, mlt_producer producer, mlt_position in, mlt_position out ) -{ - // Check that we have room - if ( this->count >= this->size ) - { - int i; - this->list = realloc( this->list, ( this->size + 10 ) * sizeof( playlist_entry * ) ); - for ( i = this->size; i < this->size + 10; i ++ ) - this->list[ i ] = NULL; - this->size += 10; - } - - this->list[ this->count ] = calloc( sizeof( playlist_entry ), 1 ); - this->list[ this->count ]->producer = producer; - this->list[ this->count ]->frame_in = in; - this->list[ this->count ]->frame_out = out; - this->list[ this->count ]->frame_count = out - in + 1; - - mlt_properties_set( mlt_producer_properties( producer ), "eof", "continue" ); - - mlt_producer_set_speed( producer, 0 ); - - this->count ++; - - return mlt_playlist_virtual_refresh( this ); -} - -/** Seek in the virtual playlist. -*/ - -static mlt_producer mlt_playlist_virtual_seek( mlt_playlist this ) -{ - // Default producer to blank - mlt_producer producer = NULL; - - // Map playlist position to real producer in virtual playlist - mlt_position position = mlt_producer_frame( &this->parent ); - - // Total number of frames - int64_t total = 0; - - // Get the properties - mlt_properties properties = mlt_playlist_properties( this ); - - // Get the eof handling - char *eof = mlt_properties_get( properties, "eof" ); - - // Index for the main loop - int i = 0; - - // Loop for each producer until found - for ( i = 0; i < this->count; i ++ ) - { - // Increment the total - total += this->list[ i ]->frame_count; - - // Check if the position indicates that we have found the clip - if ( position < this->list[ i ]->frame_count ) - { - // Found it, now break - producer = this->list[ i ]->producer; - break; - } - else - { - // Decrement position by length of this entry - position -= this->list[ i ]->frame_count; - } - } - - // Seek in real producer to relative position - if ( producer != NULL ) - { - position += this->list[ i ]->frame_in; - mlt_producer_seek( producer, position ); - } - else if ( !strcmp( eof, "pause" ) && total > 0 ) - { - playlist_entry *entry = this->list[ this->count - 1 ]; - mlt_producer this_producer = mlt_playlist_producer( this ); - mlt_producer_seek( this_producer, total - 1 - mlt_producer_get_in( this_producer ) ); - producer = entry->producer; - mlt_producer_seek( producer, entry->frame_out ); - mlt_producer_set_speed( this_producer, 0 ); - } - else if ( !strcmp( eof, "loop" ) && total > 0 ) - { - playlist_entry *entry = this->list[ 0 ]; - mlt_producer this_producer = mlt_playlist_producer( this ); - mlt_producer_seek( this_producer, 0 ); - producer = entry->producer; - mlt_producer_seek( producer, entry->frame_in ); - } - else - { - producer = &this->blank; - } - - return producer; -} - -/** Invoked when a producer indicates that it has prematurely reached its end. -*/ - -static mlt_producer mlt_playlist_virtual_set_out( mlt_playlist this ) -{ - // Default producer to blank - mlt_producer producer = &this->blank; - - // Map playlist position to real producer in virtual playlist - mlt_position position = mlt_producer_frame( &this->parent ); - - // Loop through the virtual playlist - int i = 0; - - for ( i = 0; i < this->count; i ++ ) - { - if ( position < this->list[ i ]->frame_count ) - { - // Found it, now break - producer = this->list[ i ]->producer; - break; - } - else - { - // Decrement position by length of this entry - position -= this->list[ i ]->frame_count; - } - } - - // Seek in real producer to relative position - if ( i < this->count ) - { - // Update the frame_count for the changed clip (hmmm) - this->list[ i ]->frame_out = position; - this->list[ i ]->frame_count = this->list[ i ]->frame_out - this->list[ i ]->frame_in + 1; - - // Refresh the playlist - mlt_playlist_virtual_refresh( this ); - } - - return producer; -} - -/** Obtain the current clips index. -*/ - -int mlt_playlist_current_clip( mlt_playlist this ) -{ - // Map playlist position to real producer in virtual playlist - mlt_position position = mlt_producer_frame( &this->parent ); - - // Loop through the virtual playlist - int i = 0; - - for ( i = 0; i < this->count; i ++ ) - { - if ( position < this->list[ i ]->frame_count ) - { - // Found it, now break - break; - } - else - { - // Decrement position by length of this entry - position -= this->list[ i ]->frame_count; - } - } - - return i; -} - -/** Obtain the current clips producer. -*/ - -mlt_producer mlt_playlist_current( mlt_playlist this ) -{ - int i = mlt_playlist_current_clip( this ); - if ( i < this->count ) - return this->list[ i ]->producer; - else - return &this->blank; -} - -/** Get the position which corresponds to the start of the next clip. -*/ - -mlt_position mlt_playlist_clip( mlt_playlist this, mlt_whence whence, int index ) -{ - mlt_position position = 0; - int absolute_clip = index; - int i = 0; - - // Determine the absolute clip - switch ( whence ) - { - case mlt_whence_relative_start: - absolute_clip = index; - break; - - case mlt_whence_relative_current: - absolute_clip = mlt_playlist_current_clip( this ) + index; - break; - - case mlt_whence_relative_end: - absolute_clip = this->count - index; - break; - } - - // Check that we're in a valid range - if ( absolute_clip < 0 ) - absolute_clip = 0; - else if ( absolute_clip > this->count ) - absolute_clip = this->count; - - // Now determine the position - for ( i = 0; i < absolute_clip; i ++ ) - position += this->list[ i ]->frame_count; - - return position; -} - -/** Get all the info about the clip specified. -*/ - -int mlt_playlist_get_clip_info( mlt_playlist this, mlt_playlist_clip_info *info, int index ) -{ - int error = index < 0 || index >= this->count; - memset( info, 0, sizeof( mlt_playlist_clip_info ) ); - if ( !error ) - { - mlt_producer producer = this->list[ index ]->producer; - mlt_properties properties = mlt_producer_properties( producer ); - info->clip = index; - info->producer = producer; - info->start = mlt_playlist_clip( this, mlt_whence_relative_start, index ); - info->resource = mlt_properties_get( properties, "resource" ); - info->frame_in = this->list[ index ]->frame_in; - info->frame_out = this->list[ index ]->frame_out; - info->frame_count = this->list[ index ]->frame_count; - info->length = mlt_producer_get_length( producer ); - info->fps = mlt_producer_get_fps( producer ); - } - return error; -} - -/** Get number of clips in the playlist. -*/ - -int mlt_playlist_count( mlt_playlist this ) -{ - return this->count; -} - -/** Clear the playlist. -*/ - -int mlt_playlist_clear( mlt_playlist this ) -{ - this->count = 0; - mlt_properties_set_double( mlt_playlist_properties( this ), "first_fps", 0 ); - return mlt_playlist_virtual_refresh( this ); -} - -/** Append a producer to the playlist. -*/ - -int mlt_playlist_append( mlt_playlist this, mlt_producer producer ) -{ - // Append to virtual list - return mlt_playlist_virtual_append( this, producer, 0, mlt_producer_get_playtime( producer ) - 1 ); -} - -/** Append a producer to the playlist with in/out points. -*/ - -int mlt_playlist_append_io( mlt_playlist this, mlt_producer producer, mlt_position in, mlt_position out ) -{ - // Append to virtual list - if ( in != -1 && out != -1 ) - return mlt_playlist_virtual_append( this, producer, in, out ); - else - return mlt_playlist_append( this, producer ); -} - -/** Append a blank to the playlist of a given length. -*/ - -int mlt_playlist_blank( mlt_playlist this, mlt_position length ) -{ - // Append to the virtual list - return mlt_playlist_virtual_append( this, &this->blank, 0, length ); -} - -/** Insert a producer into the playlist. -*/ - -int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_position in, mlt_position out ) -{ - // Append to end - mlt_playlist_append_io( this, producer, in, out ); - - // Move to the position specified - return mlt_playlist_move( this, this->count - 1, where ); -} - -/** Remove an entry in the playlist. -*/ - -int mlt_playlist_remove( mlt_playlist this, int where ) -{ - if ( this->count > 0 ) - { - // We need to know the current clip and the position within the playlist - int current = mlt_playlist_current_clip( this ); - mlt_position position = mlt_producer_position( mlt_playlist_producer( this ) ); - - // We need all the details about the clip we're removing - mlt_playlist_clip_info where_info; - - // Loop variable - int i = 0; - - // Make sure the clip to be removed is valid and correct if necessary - if ( where < 0 ) - where = 0; - if ( where >= this->count ) - where = this->count - 1; - - // Get the clip info of the clip to be removed - mlt_playlist_get_clip_info( this, &where_info, where ); - - // Reorganise the list - for ( i = where + 1; i < this->count; i ++ ) - this->list[ i - 1 ] = this->list[ i ]; - this->count --; - - // Correct position - if ( where == current ) - mlt_producer_seek( mlt_playlist_producer( this ), where_info.start ); - else if ( where < current && this->count > 0 ) - mlt_producer_seek( mlt_playlist_producer( this ), position - where_info.frame_count ); - else if ( this->count == 0 ) - mlt_producer_seek( mlt_playlist_producer( this ), 0 ); - } - - return 0; -} - -/** Move an entry in the playlist. -*/ - -int mlt_playlist_move( mlt_playlist this, int src, int dest ) -{ - int i; - - /* We need to ensure that the requested indexes are valid and correct it as necessary */ - if ( src < 0 ) - src = 0; - if ( src >= this->count ) - src = this->count - 1; - - if ( dest < 0 ) - dest = 0; - if ( dest >= this->count ) - dest = this->count - 1; - - if ( src != dest && this->count > 1 ) - { - int current = mlt_playlist_current_clip( this ); - mlt_position position = mlt_producer_position( mlt_playlist_producer( this ) ); - playlist_entry *src_entry = NULL; - - // We need all the details about the current clip - mlt_playlist_clip_info current_info; - - mlt_playlist_get_clip_info( this, ¤t_info, current ); - position -= current_info.start; - - if ( current == src ) - current = dest; - else if ( current > src && current < dest ) - current ++; - else if ( current == dest ) - current = src; - - if ( src > dest ) - { - int t = dest; - dest = src; - src = t; - } - - src_entry = this->list[ src ]; - - for ( i = src + 1; i <= dest; i ++ ) - this->list[ i - 1 ] = this->list[ i ]; - - this->list[ dest ] = src_entry; - - mlt_playlist_get_clip_info( this, ¤t_info, current ); - mlt_producer_seek( mlt_playlist_producer( this ), current_info.start + position ); - } - - return 0; -} - -/** Resize the current clip. -*/ - -int mlt_playlist_resize_clip( mlt_playlist this, int clip, mlt_position in, mlt_position out ) -{ - int error = clip < 0 || clip >= this->count; - if ( error == 0 ) - { - playlist_entry *entry = this->list[ clip ]; - mlt_producer producer = entry->producer; - - if ( in <= -1 ) - in = 0; - if ( out <= -1 || out >= mlt_producer_get_playtime( producer ) ) - out = mlt_producer_get_playtime( producer ) - 1; - - if ( out < in ) - { - mlt_position t = in; - in = out; - out = t; - } - - entry->frame_in = in; - entry->frame_out = out; - entry->frame_count = out - in + 1; - mlt_playlist_virtual_refresh( this ); - } - return error; -} - -/** Get the current frame. -*/ - -static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index ) -{ - // Get this mlt_playlist - mlt_playlist this = producer->child; - - // Get the real producer - mlt_producer real = mlt_playlist_virtual_seek( this ); - - // Get the frame - mlt_service_get_frame( mlt_producer_service( real ), frame, index ); - - // Check if we're at the end of the clip - mlt_properties properties = mlt_frame_properties( *frame ); - if ( mlt_properties_get_int( properties, "end_of_clip" ) ) - mlt_playlist_virtual_set_out( this ); - - // Check for notifier and call with appropriate argument - mlt_properties playlist_properties = mlt_producer_properties( producer ); - void ( *notifier )( void * ) = mlt_properties_get_data( playlist_properties, "notifier", NULL ); - if ( notifier != NULL ) - { - void *argument = mlt_properties_get_data( playlist_properties, "notifier_arg", NULL ); - notifier( argument ); - } - - // Update position on the frame we're creating - mlt_frame_set_position( *frame, mlt_producer_frame( producer ) ); - - // Position ourselves on the next frame - mlt_producer_prepare_next( producer ); - - return 0; -} - -/** Close the playlist. -*/ - -void mlt_playlist_close( mlt_playlist this ) -{ - mlt_producer_close( &this->parent ); - mlt_producer_close( &this->blank ); - free( this ); -} diff --git a/mlt/src/framework/mlt_playlist.h b/mlt/src/framework/mlt_playlist.h deleted file mode 100644 index 7bad6db..0000000 --- a/mlt/src/framework/mlt_playlist.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * mlt_playlist.h -- playlist service class - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_PLAYLIST_H_ -#define _MLT_PLAYLIST_H_ - -#include "mlt_producer.h" - -/** Structure for returning clip information. -*/ - -typedef struct -{ - int clip; - mlt_producer producer; - mlt_position start; - char *resource; - mlt_position frame_in; - mlt_position frame_out; - mlt_position frame_count; - mlt_position length; - float fps; -} -mlt_playlist_clip_info; - -/** Public final methods -*/ - -extern mlt_playlist mlt_playlist_init( ); -extern mlt_producer mlt_playlist_producer( mlt_playlist this ); -extern mlt_service mlt_playlist_service( mlt_playlist this ); -extern mlt_properties mlt_playlist_properties( mlt_playlist this ); -extern int mlt_playlist_count( mlt_playlist this ); -extern int mlt_playlist_clear( mlt_playlist this ); -extern int mlt_playlist_append( mlt_playlist this, mlt_producer producer ); -extern int mlt_playlist_append_io( mlt_playlist this, mlt_producer producer, mlt_position in, mlt_position out ); -extern int mlt_playlist_blank( mlt_playlist this, mlt_position length ); -extern mlt_position mlt_playlist_clip( mlt_playlist this, mlt_whence whence, int index ); -extern int mlt_playlist_current_clip( mlt_playlist this ); -extern mlt_producer mlt_playlist_current( mlt_playlist this ); -extern int mlt_playlist_get_clip_info( mlt_playlist this, mlt_playlist_clip_info *info, int index ); -extern int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_position in, mlt_position out ); -extern int mlt_playlist_remove( mlt_playlist this, int where ); -extern int mlt_playlist_move( mlt_playlist this, int from, int to ); -extern int mlt_playlist_resize_clip( mlt_playlist this, int clip, mlt_position in, mlt_position out ); -extern void mlt_playlist_close( mlt_playlist this ); - -#endif - diff --git a/mlt/src/framework/mlt_producer.c b/mlt/src/framework/mlt_producer.c deleted file mode 100644 index 21f5277..0000000 --- a/mlt/src/framework/mlt_producer.c +++ /dev/null @@ -1,271 +0,0 @@ -/* - * mlt_producer.c -- abstraction for all producer services - * 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 program 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. - * - * 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. - */ - -#include "config.h" -#include "mlt_producer.h" -#include "mlt_frame.h" -#include -#include -#include -#include - -/** Forward references. -*/ - -static int producer_get_frame( mlt_service this, mlt_frame_ptr frame, int index ); - -/** Constructor -*/ - -int mlt_producer_init( mlt_producer this, void *child ) -{ - // Initialise the producer - memset( this, 0, sizeof( struct mlt_producer_s ) ); - - // Associate with the child - this->child = child; - - // Initialise the service - if ( mlt_service_init( &this->parent, this ) == 0 ) - { - // The parent is the service - mlt_service parent = &this->parent; - - // Get the properties of the parent - mlt_properties properties = mlt_service_properties( parent ); - - // Set the default properties - mlt_properties_set( properties, "mlt_type", "mlt_producer" ); - mlt_properties_set_position( properties, "position", 0.0 ); - mlt_properties_set_double( properties, "frame", 0 ); - mlt_properties_set_double( properties, "fps", 25.0 ); - mlt_properties_set_double( properties, "speed", 1.0 ); - mlt_properties_set_position( properties, "in", 0 ); - mlt_properties_set_position( properties, "out", 1799999 ); - mlt_properties_set_position( properties, "length", 1800000 ); - mlt_properties_set_double( properties, "aspect_ratio", 4.0 / 3.0 ); - mlt_properties_set( properties, "eof", "pause" ); - mlt_properties_set( properties, "resource", "" ); - - // Override service get_frame - parent->get_frame = producer_get_frame; - } - - return 0; -} - -/** Get the parent service object. -*/ - -mlt_service mlt_producer_service( mlt_producer this ) -{ - return &this->parent; -} - -/** Get the producer properties. -*/ - -mlt_properties mlt_producer_properties( mlt_producer this ) -{ - return mlt_service_properties( &this->parent ); -} - -/** Seek to a specified position. -*/ - -int mlt_producer_seek( mlt_producer this, mlt_position position ) -{ - // Determine eof handling - char *eof = mlt_properties_get( mlt_producer_properties( this ), "eof" ); - - // Check bounds - if ( position < 0 ) - position = 0; - else if ( !strcmp( eof, "pause" ) && position >= mlt_producer_get_playtime( this ) ) - position = mlt_producer_get_playtime( this ) - 1; - - // Set the position - mlt_properties_set_position( mlt_producer_properties( this ), "position", position ); - - // Calculate the absolute frame - mlt_properties_set_position( mlt_producer_properties( this ), "frame", mlt_producer_get_in( this ) + position ); - - return 0; -} - -/** Get the current position (relative to in point). -*/ - -mlt_position mlt_producer_position( mlt_producer this ) -{ - return mlt_properties_get_position( mlt_producer_properties( this ), "position" ); -} - -/** Get the current position (relative to start of producer). -*/ - -mlt_position mlt_producer_frame( mlt_producer this ) -{ - return mlt_properties_get_position( mlt_producer_properties( this ), "frame" ); -} - -/** Set the playing speed. -*/ - -int mlt_producer_set_speed( mlt_producer this, double speed ) -{ - return mlt_properties_set_double( mlt_producer_properties( this ), "speed", speed ); -} - -/** Get the playing speed. -*/ - -double mlt_producer_get_speed( mlt_producer this ) -{ - return mlt_properties_get_double( mlt_producer_properties( this ), "speed" ); -} - -/** Get the frames per second. -*/ - -double mlt_producer_get_fps( mlt_producer this ) -{ - return mlt_properties_get_double( mlt_producer_properties( this ), "fps" ); -} - -/** Set the in and out points. -*/ - -int mlt_producer_set_in_and_out( mlt_producer this, mlt_position in, mlt_position out ) -{ - // Correct ins and outs if necessary - if ( in < 0 ) - in = 0; - else if ( in > mlt_producer_get_length( this ) ) - in = mlt_producer_get_length( this ); - - if ( out < 0 ) - out = 0; - else if ( out > mlt_producer_get_length( this ) ) - out = mlt_producer_get_length( this ); - - // Swap ins and outs if wrong - if ( out < in ) - { - mlt_position t = in; - in = out; - out = t; - } - - // Set the values - mlt_properties_set_position( mlt_producer_properties( this ), "in", in ); - mlt_properties_set_position( mlt_producer_properties( this ), "out", out ); - - return 0; -} - -/** Get the in point. -*/ - -mlt_position mlt_producer_get_in( mlt_producer this ) -{ - return mlt_properties_get_position( mlt_producer_properties( this ), "in" ); -} - -/** Get the out point. -*/ - -mlt_position mlt_producer_get_out( mlt_producer this ) -{ - return mlt_properties_get_position( mlt_producer_properties( this ), "out" ); -} - -/** Get the total play time. -*/ - -mlt_position mlt_producer_get_playtime( mlt_producer this ) -{ - return mlt_producer_get_out( this ) - mlt_producer_get_in( this ) + 1; -} - -/** Get the total length of the producer. -*/ - -mlt_position mlt_producer_get_length( mlt_producer this ) -{ - return mlt_properties_get_position( mlt_producer_properties( this ), "length" ); -} - -/** Prepare for next frame. -*/ - -void mlt_producer_prepare_next( mlt_producer this ) -{ - mlt_producer_seek( this, mlt_producer_position( this ) + mlt_producer_get_speed( this ) ); -} - -/** Get a frame. -*/ - -static int producer_get_frame( mlt_service service, mlt_frame_ptr frame, int index ) -{ - int result = 1; - mlt_producer this = service->child; - - // Determine eof handling - char *eof = mlt_properties_get( mlt_producer_properties( this ), "eof" ); - - // A properly instatiated producer will have a get_frame method... - if ( this->get_frame == NULL || ( !strcmp( eof, "continue" ) && mlt_producer_position( this ) > mlt_producer_get_out( this ) ) ) - { - // Generate a test frame - *frame = mlt_frame_init( ); - - // Set the position - result = mlt_frame_set_position( *frame, mlt_producer_position( this ) ); - - // Calculate the next position - mlt_producer_prepare_next( this ); - } - else - { - // Get the frame from the implementation - result = this->get_frame( this, frame, index ); - } - - // Copy the fps and speed of the producer onto the frame - mlt_properties properties = mlt_frame_properties( *frame ); - mlt_properties_set_double( properties, "fps", mlt_producer_get_fps( this ) ); - double speed = mlt_producer_get_speed( this ); - mlt_properties_set_double( properties, "speed", speed ); - - return 0; -} - -/** Close the producer. -*/ - -void mlt_producer_close( mlt_producer this ) -{ - if ( this->close != NULL ) - this->close( this ); - else - mlt_service_close( &this->parent ); -} diff --git a/mlt/src/framework/mlt_producer.h b/mlt/src/framework/mlt_producer.h deleted file mode 100644 index 7e748c0..0000000 --- a/mlt/src/framework/mlt_producer.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * mlt_producer.h -- abstraction for all producer services - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_PRODUCER_H_ -#define _MLT_PRODUCER_H_ - -#include "mlt_service.h" - -/** The interface definition for all producers. -*/ - -struct mlt_producer_s -{ - // We're implementing service here - struct mlt_service_s parent; - - // Public virtual methods - int ( *get_frame )( mlt_producer, mlt_frame_ptr, int ); - void ( *close )( mlt_producer ); - - // Private data - void *private; - void *child; -}; - -/** Public final methods -*/ - -//extern double mlt_producer_convert_position_to_time( mlt_producer this, int64_t frame ); -//extern mlt_position mlt_producer_convert_time_to_position( mlt_producer this, double time ); - -extern int mlt_producer_init( mlt_producer this, void *child ); -extern mlt_service mlt_producer_service( mlt_producer this ); -extern mlt_properties mlt_producer_properties( mlt_producer this ); -extern int mlt_producer_seek( mlt_producer this, mlt_position position ); -extern mlt_position mlt_producer_position( mlt_producer this ); -extern mlt_position mlt_producer_frame( mlt_producer this ); -extern int mlt_producer_set_speed( mlt_producer this, double speed ); -extern double mlt_producer_get_speed( mlt_producer this ); -extern double mlt_producer_get_fps( mlt_producer this ); -extern int mlt_producer_set_in_and_out( mlt_producer this, mlt_position in, mlt_position out ); -extern mlt_position mlt_producer_get_in( mlt_producer this ); -extern mlt_position mlt_producer_get_out( mlt_producer this ); -extern mlt_position mlt_producer_get_playtime( mlt_producer this ); -extern mlt_position mlt_producer_get_length( mlt_producer this ); -extern void mlt_producer_prepare_next( mlt_producer this ); -extern void mlt_producer_close( mlt_producer this ); - -#endif diff --git a/mlt/src/framework/mlt_properties.c b/mlt/src/framework/mlt_properties.c deleted file mode 100644 index a0f39f2..0000000 --- a/mlt/src/framework/mlt_properties.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * mlt_properties.c -- base properties class - * 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 program 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. - * - * 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. - */ - -#include "config.h" -#include "mlt_properties.h" -#include "mlt_property.h" - -#include -#include -#include - -/* ---------------- // Private Implementation // ---------------- */ - -/** Private implementation of the property list. -*/ - -typedef struct -{ - char **name; - mlt_property *value; - int count; - int size; -} -property_list; - -/** Basic implementation. -*/ - -int mlt_properties_init( mlt_properties this, void *child ) -{ - // NULL all methods - memset( this, 0, sizeof( struct mlt_properties_s ) ); - - // Assign the child of the object - this->child = child; - - // Allocate the private structure - this->private = calloc( sizeof( property_list ), 1 ); - - return this->private == NULL; -} - -/** Constructor for stand alone object. -*/ - -mlt_properties mlt_properties_new( ) -{ - // Construct a standalone properties object - mlt_properties this = calloc( sizeof( struct mlt_properties_s ), 1 ); - - // Initialise this - mlt_properties_init( this, NULL ); - - // Return the pointer - return this; -} - -/** Inherit all serialisable properties from that into this. -*/ - -int mlt_properties_inherit( mlt_properties this, mlt_properties that ) -{ - int count = mlt_properties_count( that ); - while ( count -- ) - { - char *value = mlt_properties_get_value( that, count ); - if ( value != NULL ) - { - char *name = mlt_properties_get_name( that, count ); - mlt_properties_set( this, name, value ); - } - } - return 0; -} - -/** Locate a property by name -*/ - -static mlt_property mlt_properties_find( mlt_properties this, char *name ) -{ - mlt_property value = NULL; - property_list *list = this->private; - int i = 0; - - // Locate the item - for ( i = 0; value == NULL && i < list->count; i ++ ) - if ( !strcmp( list->name[ i ], name ) ) - value = list->value[ i ]; - - return value; -} - -/** Add a new property. -*/ - -static mlt_property mlt_properties_add( mlt_properties this, char *name ) -{ - property_list *list = this->private; - - // Check that we have space and resize if necessary - if ( list->count == list->size ) - { - list->size += 10; - list->name = realloc( list->name, list->size * sizeof( char * ) ); - list->value = realloc( list->value, list->size * sizeof( mlt_property ) ); - } - - // Assign name/value pair - list->name[ list->count ] = strdup( name ); - list->value[ list->count ] = mlt_property_init( ); - - // Return and increment count accordingly - return list->value[ list->count ++ ]; -} - -/** Fetch a property by name - this includes add if not found. -*/ - -static mlt_property mlt_properties_fetch( mlt_properties this, char *name ) -{ - // Try to find an existing property first - mlt_property property = mlt_properties_find( this, name ); - - // If it wasn't found, create one - if ( property == NULL ) - property = mlt_properties_add( this, name ); - - // Return the property - return property; -} - -/** Set the property. -*/ - -int mlt_properties_set( mlt_properties this, char *name, char *value ) -{ - int error = 1; - - // Fetch the property to work with - mlt_property property = mlt_properties_fetch( this, name ); - - // Set it if not NULL - if ( property != NULL ) - error = mlt_property_set_string( property, value ); - - return error; -} - -/** Get a string value by name. -*/ - -char *mlt_properties_get( mlt_properties this, char *name ) -{ - mlt_property value = mlt_properties_find( this, name ); - return value == NULL ? NULL : mlt_property_get_string( value ); -} - -/** Get a name by index. -*/ - -char *mlt_properties_get_name( mlt_properties this, int index ) -{ - property_list *list = this->private; - if ( index >= 0 && index < list->count ) - return list->name[ index ]; - return NULL; -} - -/** Get a string value by index. -*/ - -char *mlt_properties_get_value( mlt_properties this, int index ) -{ - property_list *list = this->private; - if ( index >= 0 && index < list->count ) - return mlt_property_get_string( list->value[ index ] ); - return NULL; -} - -/** Return the number of items in the list. -*/ - -int mlt_properties_count( mlt_properties this ) -{ - property_list *list = this->private; - return list->count; -} - -/** Set a value by parsing a name=value string -*/ - -int mlt_properties_parse( mlt_properties this, char *namevalue ) -{ - char *name = strdup( namevalue ); - char *value = strdup( namevalue ); - int error = 0; - - if ( strchr( name, '=' ) ) - { - *( strchr( name, '=' ) ) = '\0'; - strcpy( value, strchr( value, '=' ) + 1 ); - } - else - { - strcpy( value, "" ); - } - - error = mlt_properties_set( this, name, value ); - - free( name ); - free( value ); - - return error; -} - -/** Get a value associated to the name. -*/ - -int mlt_properties_get_int( mlt_properties this, char *name ) -{ - mlt_property value = mlt_properties_find( this, name ); - return value == NULL ? 0 : mlt_property_get_int( value ); -} - -/** Set a value associated to the name. -*/ - -int mlt_properties_set_int( mlt_properties this, char *name, int value ) -{ - int error = 1; - - // Fetch the property to work with - mlt_property property = mlt_properties_fetch( this, name ); - - // Set it if not NULL - if ( property != NULL ) - error = mlt_property_set_int( property, value ); - - return error; -} - -/** Get a value associated to the name. -*/ - -double mlt_properties_get_double( mlt_properties this, char *name ) -{ - mlt_property value = mlt_properties_find( this, name ); - return value == NULL ? 0 : mlt_property_get_double( value ); -} - -/** Set a value associated to the name. -*/ - -int mlt_properties_set_double( mlt_properties this, char *name, double value ) -{ - int error = 1; - - // Fetch the property to work with - mlt_property property = mlt_properties_fetch( this, name ); - - // Set it if not NULL - if ( property != NULL ) - error = mlt_property_set_double( property, value ); - - return error; -} - -/** Get a value associated to the name. -*/ - -mlt_position mlt_properties_get_position( mlt_properties this, char *name ) -{ - mlt_property value = mlt_properties_find( this, name ); - return value == NULL ? 0 : mlt_property_get_position( value ); -} - -/** Set a value associated to the name. -*/ - -int mlt_properties_set_position( mlt_properties this, char *name, mlt_position value ) -{ - int error = 1; - - // Fetch the property to work with - mlt_property property = mlt_properties_fetch( this, name ); - - // Set it if not NULL - if ( property != NULL ) - error = mlt_property_set_position( property, value ); - - return error; -} - -/** Get a value associated to the name. -*/ - -void *mlt_properties_get_data( mlt_properties this, char *name, int *length ) -{ - mlt_property value = mlt_properties_find( this, name ); - return value == NULL ? NULL : mlt_property_get_data( value, length ); -} - -/** Set a value associated to the name. -*/ - -int mlt_properties_set_data( mlt_properties this, char *name, void *value, int length, mlt_destructor destroy, mlt_serialiser serialise ) -{ - int error = 1; - - // Fetch the property to work with - mlt_property property = mlt_properties_fetch( this, name ); - - // Set it if not NULL - if ( property != NULL ) - error = mlt_property_set_data( property, value, length, destroy, serialise ); - - return error; -} - -/** Close the list. -*/ - -void mlt_properties_close( mlt_properties this ) -{ - property_list *list = this->private; - int index = 0; - - // Clean up names and values - for ( index = 0; index < list->count; index ++ ) - { - free( list->name[ index ] ); - mlt_property_close( list->value[ index ] ); - } - - // Clear up the list - free( list->name ); - free( list->value ); - free( list ); - - // Free this now if this has no child - if ( this->child == NULL ) - free( this ); -} - diff --git a/mlt/src/framework/mlt_properties.h b/mlt/src/framework/mlt_properties.h deleted file mode 100644 index 2cacc9f..0000000 --- a/mlt/src/framework/mlt_properties.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * mlt_properties.h -- base properties class - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_PROPERTIES_H_ -#define _MLT_PROPERTIES_H_ - -#include "mlt_types.h" - -/** The properties base class defines the basic property propagation and - handling. -*/ - -struct mlt_properties_s -{ - void *child; - void *private; -}; - -/** Public interface. -*/ - -extern int mlt_properties_init( mlt_properties, void *child ); -extern mlt_properties mlt_properties_new( ); -extern int mlt_properties_inherit( mlt_properties this, mlt_properties that ); -extern int mlt_properties_set( mlt_properties this, char *name, char *value ); -extern int mlt_properties_parse( mlt_properties this, char *namevalue ); -extern char *mlt_properties_get( mlt_properties this, char *name ); -extern char *mlt_properties_get_name( mlt_properties this, int index ); -extern char *mlt_properties_get_value( mlt_properties this, int index ); -extern int mlt_properties_get_int( mlt_properties this, char *name ); -extern int mlt_properties_set_int( mlt_properties this, char *name, int value ); -extern double mlt_properties_get_double( mlt_properties this, char *name ); -extern int mlt_properties_set_double( mlt_properties this, char *name, double value ); -extern mlt_position mlt_properties_get_position( mlt_properties this, char *name ); -extern int mlt_properties_set_position( mlt_properties this, char *name, mlt_position value ); -extern int mlt_properties_set_data( mlt_properties this, char *name, void *value, int length, mlt_destructor, mlt_serialiser ); -extern void *mlt_properties_get_data( mlt_properties this, char *name, int *length ); -extern int mlt_properties_count( mlt_properties this ); -extern void mlt_properties_close( mlt_properties this ); - -#endif diff --git a/mlt/src/framework/mlt_property.c b/mlt/src/framework/mlt_property.c deleted file mode 100644 index 0a47529..0000000 --- a/mlt/src/framework/mlt_property.c +++ /dev/null @@ -1,263 +0,0 @@ -/* - * mlt_property.c -- property class - * 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 program 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. - * - * 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. - */ - -#include "config.h" - -#include "mlt_property.h" - -#include -#include -#include - -/** Construct and uninitialised property. -*/ - -mlt_property mlt_property_init( ) -{ - return calloc( sizeof( struct mlt_property_s ), 1 ); -} - -/** Clear a property. -*/ - -void mlt_property_clear( mlt_property this ) -{ - // Special case data handling - if ( this->types & mlt_prop_data && this->destructor != NULL ) - this->destructor( this->data ); - - // Special case string handling - if ( this->types & mlt_prop_string ) - free( this->prop_string ); - - // We can wipe it now. - memset( this, 0, sizeof( struct mlt_property_s ) ); -} - -/** Set an int on this property. -*/ - -int mlt_property_set_int( mlt_property this, int value ) -{ - mlt_property_clear( this ); - this->types = mlt_prop_int; - this->prop_int = value; - return 0; -} - -/** Set a double on this property. -*/ - -int mlt_property_set_double( mlt_property this, double value ) -{ - mlt_property_clear( this ); - this->types = mlt_prop_double; - this->prop_double = value; - return 0; -} - -/** Set a position on this property. -*/ - -int mlt_property_set_position( mlt_property this, mlt_position value ) -{ - mlt_property_clear( this ); - this->types = mlt_prop_position; - this->prop_position = value; - return 0; -} - -/** Set a string on this property. -*/ - -int mlt_property_set_string( mlt_property this, char *value ) -{ - mlt_property_clear( this ); - this->types = mlt_prop_string; - if ( value != NULL ) - this->prop_string = strdup( value ); - return this->prop_string != NULL; -} - -/** Set an int64 on this property. -*/ - -int mlt_property_set_int64( mlt_property this, int64_t value ) -{ - mlt_property_clear( this ); - this->types = mlt_prop_int64; - this->prop_int64 = value; - return 0; -} - -/** Set a data on this property. -*/ - -int mlt_property_set_data( mlt_property this, void *value, int length, mlt_destructor destructor, mlt_serialiser serialiser ) -{ - if ( this->data == value ) - this->destructor = NULL; - mlt_property_clear( this ); - this->types = mlt_prop_data; - this->data = value; - this->length = length; - this->destructor = destructor; - this->serialiser = serialiser; - return 0; -} - -/** Get an int from this property. -*/ - -int mlt_property_get_int( mlt_property this ) -{ - if ( this->types & mlt_prop_int ) - return this->prop_int; - else if ( this->types & mlt_prop_double ) - return ( int )this->prop_double; - else if ( this->types & mlt_prop_position ) - return ( int )this->prop_position; - else if ( this->types & mlt_prop_int64 ) - return ( int )this->prop_int64; - else if ( this->types & mlt_prop_string ) - return atoi( this->prop_string ); - return 0; -} - -/** Get a double from this property. -*/ - -double mlt_property_get_double( mlt_property this ) -{ - if ( this->types & mlt_prop_double ) - return this->prop_double; - else if ( this->types & mlt_prop_int ) - return ( double )this->prop_int; - else if ( this->types & mlt_prop_position ) - return ( double )this->prop_position; - else if ( this->types & mlt_prop_int64 ) - return ( double )this->prop_int64; - else if ( this->types & mlt_prop_string ) - return atof( this->prop_string ); - return 0; -} - -/** Get a position from this property. -*/ - -mlt_position mlt_property_get_position( mlt_property this ) -{ - if ( this->types & mlt_prop_position ) - return this->prop_position; - else if ( this->types & mlt_prop_int ) - return ( mlt_position )this->prop_int; - else if ( this->types & mlt_prop_double ) - return ( mlt_position )this->prop_double; - else if ( this->types & mlt_prop_int64 ) - return ( mlt_position )this->prop_int64; - else if ( this->types & mlt_prop_string ) - return ( mlt_position )atol( this->prop_string ); - return 0; -} - -/** Get an int64 from this property. -*/ - -int64_t mlt_property_get_int64( mlt_property this ) -{ - if ( this->types & mlt_prop_int64 ) - return this->prop_int64; - else if ( this->types & mlt_prop_int ) - return ( int64_t )this->prop_int; - else if ( this->types & mlt_prop_double ) - return ( int64_t )this->prop_double; - else if ( this->types & mlt_prop_position ) - return ( int64_t )this->prop_position; - else if ( this->types & mlt_prop_string ) - return ( int64_t )atol( this->prop_string ); - return 0; -} - -/** Get a string from this property. -*/ - -char *mlt_property_get_string( mlt_property this ) -{ - // Construct a string if need be - if ( ! ( this->types & mlt_prop_string ) ) - { - if ( this->types & mlt_prop_int ) - { - this->types |= mlt_prop_string; - this->prop_string = malloc( 32 ); - sprintf( this->prop_string, "%d", this->prop_int ); - } - else if ( this->types & mlt_prop_double ) - { - this->types |= mlt_prop_string; - this->prop_string = malloc( 32 ); - sprintf( this->prop_string, "%e", this->prop_double ); - } - else if ( this->types & mlt_prop_position ) - { - this->types |= mlt_prop_string; - this->prop_string = malloc( 32 ); - sprintf( this->prop_string, "%lld", this->prop_position ); - } - else if ( this->types & mlt_prop_int64 ) - { - this->types |= mlt_prop_string; - this->prop_string = malloc( 32 ); - sprintf( this->prop_string, "%lld", this->prop_int64 ); - } - else if ( this->types & mlt_prop_data && this->serialiser != NULL ) - { - this->types |= mlt_prop_string; - this->prop_string = this->serialiser( this->data, this->length ); - } - } - - // Return the string (may be NULL) - return this->prop_string; -} - -/** Get a data and associated length. -*/ - -void *mlt_property_get_data( mlt_property this, int *length ) -{ - // Assign length if not NULL - if ( length != NULL ) - *length = this->length; - - // Return the data (note: there is no conversion here) - return this->data; -} - -/** Close this property. -*/ - -void mlt_property_close( mlt_property this ) -{ - mlt_property_clear( this ); - free( this ); -} - - diff --git a/mlt/src/framework/mlt_property.h b/mlt/src/framework/mlt_property.h deleted file mode 100644 index 3f59ad2..0000000 --- a/mlt/src/framework/mlt_property.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * mlt_property.h -- property class - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_PROPERTY_H_ -#define _MLT_PROPERTY_H_ - -#include "mlt_types.h" - -/** Bit pattern for properties. -*/ - -typedef enum -{ - mlt_prop_none = 0, - mlt_prop_int = 1, - mlt_prop_string = 2, - mlt_prop_position = 4, - mlt_prop_double = 8, - mlt_prop_data = 16, - mlt_prop_int64 = 32 -} -mlt_property_type; - -/** Property structure. -*/ - -typedef struct mlt_property_s -{ - // Stores a bit pattern of types available for this property - mlt_property_type types; - - // Atomic type handling - int prop_int; - mlt_position prop_position; - double prop_double; - int64_t prop_int64; - - // String handling - char *prop_string; - - // Generic type handling - void *data; - int length; - mlt_destructor destructor; - mlt_serialiser serialiser; -} -*mlt_property; - -/** API -*/ - -extern mlt_property mlt_property_init( ); -extern void mlt_property_clear( mlt_property this ); -extern int mlt_property_set_int( mlt_property this, int value ); -extern int mlt_property_set_double( mlt_property this, double value ); -extern int mlt_property_set_position( mlt_property this, mlt_position value ); -extern int mlt_property_set_uint64( mlt_property this, uint64_t value ); -extern int mlt_property_set_string( mlt_property this, char *value ); -extern int mlt_property_set_data( mlt_property this, void *value, int length, mlt_destructor destructor, mlt_serialiser serialiser ); -extern int mlt_property_get_int( mlt_property this ); -extern double mlt_property_get_double( mlt_property this ); -extern mlt_position mlt_property_get_position( mlt_property this ); -extern int64_t mlt_property_get_int64( mlt_property this ); -extern char *mlt_property_get_string( mlt_property this ); -extern void *mlt_property_get_data( mlt_property this, int *length ); -extern void mlt_property_close( mlt_property this ); - -#endif - diff --git a/mlt/src/framework/mlt_repository.c b/mlt/src/framework/mlt_repository.c deleted file mode 100644 index 9c25b21..0000000 --- a/mlt/src/framework/mlt_repository.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - * repository.c -- provides a map between service and shared objects - * 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 program 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. - * - * 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. - */ - -#include "mlt_repository.h" -#include "mlt_properties.h" - -#include -#include -#include -#include - -struct mlt_repository_s -{ - struct mlt_properties_s parent; - mlt_properties object_list; -}; - -static char *construct_full_file( char *output, char *prefix, char *file ) -{ - strcpy( output, prefix ); - if ( prefix[ strlen( prefix ) - 1 ] != '/' ) - strcat( output, "/" ); - strcat( output, file ); - return output; -} - -static char *chomp( char *input ) -{ - if ( input[ strlen( input ) - 1 ] == '\n' ) - input[ strlen( input ) - 1 ] = '\0'; - return input; -} - -static mlt_properties construct_object( char *prefix, char *id ) -{ - mlt_properties output = calloc( sizeof( struct mlt_properties_s ), 1 ); - mlt_properties_init( output, NULL ); - mlt_properties_set( output, "prefix", prefix ); - mlt_properties_set( output, "id", id ); - return output; -} - -static mlt_properties construct_service( mlt_properties object, char *id ) -{ - mlt_properties output = calloc( sizeof( struct mlt_properties_s ), 1 ); - mlt_properties_init( output, NULL ); - mlt_properties_set_data( output, "object", object, 0, NULL, NULL ); - mlt_properties_set( output, "id", id ); - return output; -} - -static void *construct_instance( mlt_properties service_properties, char *symbol, void *input ) -{ - // Extract the service - char *service = mlt_properties_get( service_properties, "id" ); - - // Get the object properties - void *object_properties = mlt_properties_get_data( service_properties, "object", NULL ); - - // Get the dlopen'd object - void *object = mlt_properties_get_data( object_properties, "dlopen", NULL ); - - // Get the dlsym'd symbol - void *( *symbol_ptr )( char *, void * ) = mlt_properties_get_data( object_properties, symbol, NULL ); - - // Check that we have object and open if we don't - if ( object == NULL ) - { - char full_file[ 512 ]; - - // Get the prefix and id of the shared object - char *prefix = mlt_properties_get( object_properties, "prefix" ); - char *file = mlt_properties_get( object_properties, "id" ); - - // Construct the full file - construct_full_file( full_file, prefix, file ); - - // Open the shared object - object = dlopen( full_file, RTLD_NOW | RTLD_GLOBAL ); - if ( object == NULL ) - fprintf( stderr, "Failed to load plugin: %s\n", dlerror() ); - - // Set it on the properties - mlt_properties_set_data( object_properties, "dlopen", object, 0, ( void (*)( void * ) )dlclose, NULL ); - } - - // Now check if we have this symbol pointer - if ( object != NULL && symbol_ptr == NULL ) - { - // Construct it now - symbol_ptr = dlsym( object, symbol ); - - // Set it on the properties - mlt_properties_set_data( object_properties, "dlsym", symbol_ptr, 0, NULL, NULL ); - } - - // Construct the service - return symbol_ptr != NULL ? symbol_ptr( service, input ) : NULL; -} - -void destroy_properties( void *arg ) -{ - mlt_properties_close( arg ); - free( arg ); -} - -mlt_repository mlt_repository_init( mlt_properties object_list, char *prefix, char *data, char *symbol ) -{ - char full_file[ 512 ]; - FILE *file; - - // Construct the repository - mlt_repository this = calloc( sizeof( struct mlt_repository_s ), 1 ); - mlt_properties_init( &this->parent, this ); - - // Add the symbol to THIS repository properties. - mlt_properties_set( &this->parent, "_symbol", symbol ); - - // Asociate the repository to the global object_list - this->object_list = object_list; - - // Construct full file - construct_full_file( full_file, prefix, data ); - - // Open the file - file = fopen( full_file, "r" ); - - // Parse the contents - if ( file != NULL ) - { - char full[ 512 ]; - char service[ 256 ]; - char object[ 256 ]; - - while( fgets( full, 512, file ) ) - { - chomp( full ); - - if ( full[ 0 ] != '#' && full[ 0 ] != '\0' && sscanf( full, "%s %s", service, object ) == 2 ) - { - // Get the object properties first - mlt_properties object_properties = mlt_properties_get_data( object_list, object, NULL ); - - // If their are no properties, create them now - if ( object_properties == NULL ) - { - // Construct the object - object_properties = construct_object( prefix, object ); - - // Add it to the object list - mlt_properties_set_data( object_list, object, object_properties, 0, destroy_properties, NULL ); - } - - // Now construct a property for the service - mlt_properties service_properties = construct_service( object_properties, service ); - - // Add it to the repository - mlt_properties_set_data( &this->parent, service, service_properties, 0, destroy_properties, NULL ); - } - } - - // Close the file - fclose( file ); - } - - return this; -} - -void *mlt_repository_fetch( mlt_repository this, char *service, void *input ) -{ - // Get the service properties - mlt_properties service_properties = mlt_properties_get_data( &this->parent, service, NULL ); - - // If the service exists - if ( service_properties != NULL ) - { - // Get the symbol that is used to generate this service - char *symbol = mlt_properties_get( &this->parent, "_symbol" ); - - // Now get an instance of the service - return construct_instance( service_properties, symbol, input ); - } - - return NULL; -} - -void mlt_repository_close( mlt_repository this ) -{ - mlt_properties_close( &this->parent ); - free( this ); -} - - diff --git a/mlt/src/framework/mlt_repository.h b/mlt/src/framework/mlt_repository.h deleted file mode 100644 index f00ad5b..0000000 --- a/mlt/src/framework/mlt_repository.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * repository.h -- provides a map between service and shared objects - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_REPOSITORY_H_ -#define _MLT_REPOSITORY_H_ - -#include "mlt_types.h" - -/** Repository structure forward reference. -*/ - -typedef struct mlt_repository_s *mlt_repository; - -/** Public functions. -*/ - -extern mlt_repository mlt_repository_init( mlt_properties object_list, char *prefix, char *file, char *symbol ); -extern void *mlt_repository_fetch( mlt_repository this, char *service, void *input ); -extern void mlt_repository_close( mlt_repository this ); - -#endif - diff --git a/mlt/src/framework/mlt_service.c b/mlt/src/framework/mlt_service.c deleted file mode 100644 index f432aae..0000000 --- a/mlt/src/framework/mlt_service.c +++ /dev/null @@ -1,293 +0,0 @@ -/* - * mlt_service.c -- interface for all service classes - * 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 program 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. - * - * 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. - */ - -#include "config.h" -#include "mlt_service.h" -#include "mlt_frame.h" -#include -#include -#include - -/** IMPORTANT NOTES - - The base service implements a null frame producing service - as such, - it is functional without extension and will produce test cards frames - and PAL sized audio frames. - - PLEASE DO NOT CHANGE THIS BEHAVIOUR!!! OVERRIDE THE METHODS THAT - CONTROL THIS IN EXTENDING CLASSES. -*/ - -/** Private service definition. -*/ - -typedef struct -{ - int size; - int count; - mlt_service *in; - mlt_service out; -} -mlt_service_base; - -/** Friends? -*/ - -static void mlt_service_disconnect( mlt_service this ); -static void mlt_service_connect( mlt_service this, mlt_service that ); -static int service_get_frame( mlt_service this, mlt_frame_ptr frame, int index ); - -/** Constructor -*/ - -int mlt_service_init( mlt_service this, void *child ) -{ - // Initialise everything to NULL - memset( this, 0, sizeof( struct mlt_service_s ) ); - - // Assign the child - this->child = child; - - // Generate private space - this->private = calloc( sizeof( mlt_service_base ), 1 ); - - // Associate the methods - this->get_frame = service_get_frame; - - // Initialise the properties - return mlt_properties_init( &this->parent, this ); -} - -/** Return the properties object. -*/ - -mlt_properties mlt_service_properties( mlt_service this ) -{ - return &this->parent; -} - -/** Connect a producer service. - Returns: > 0 warning, == 0 success, < 0 serious error - 1 = this service does not accept input - 2 = the producer is invalid - 3 = the producer is already registered with this consumer -*/ - -int mlt_service_connect_producer( mlt_service this, mlt_service producer, int index ) -{ - int i = 0; - - // Get the service base - mlt_service_base *base = this->private; - - // Does this service accept input? - if ( mlt_service_accepts_input( this ) == 0 ) - return 1; - - // Does the producer service accept output connections? - if ( mlt_service_accepts_output( producer ) == 0 ) - return 2; - - // Check if the producer is already registered with this service - for ( i = 0; i < base->count; i ++ ) - if ( base->in[ i ] == producer ) - return 3; - - // Allocate space - if ( index >= base->size ) - { - int new_size = base->size + index + 10; - base->in = realloc( base->in, new_size * sizeof( mlt_service ) ); - if ( base->in != NULL ) - { - for ( i = base->size; i < new_size; i ++ ) - base->in[ i ] = NULL; - base->size = new_size; - } - } - - // If we have space, assign the input - if ( base->in != NULL && index >= 0 && index < base->size ) - { - // Now we disconnect the producer service from its consumer - mlt_service_disconnect( producer ); - - // Add the service to index specified - base->in[ index ] = producer; - - // Determine the number of active tracks - if ( index >= base->count ) - base->count = index + 1; - - // Now we connect the producer to its connected consumer - mlt_service_connect( producer, this ); - - // Inform caller that all went well - return 0; - } - else - { - return -1; - } -} - -/** Disconnect this service from its consumer. -*/ - -void mlt_service_disconnect( mlt_service this ) -{ - // Get the service base - mlt_service_base *base = this->private; - - // There's a bit more required here... - base->out = NULL; -} - -/** Associate this service to the its consumer. -*/ - -void mlt_service_connect( mlt_service this, mlt_service that ) -{ - // Get the service base - mlt_service_base *base = this->private; - - // There's a bit more required here... - base->out = that; -} - - -/** Get the first connected producer service. -*/ - -mlt_service mlt_service_get_producer( mlt_service this ) -{ - mlt_service producer = NULL; - - // Get the service base - mlt_service_base *base = this->private; - - if ( base->in != NULL ) - producer = base->in[ 0 ]; - - return producer; -} - - -/** Get the service state. -*/ - -mlt_service_state mlt_service_get_state( mlt_service this ) -{ - mlt_service_state state = mlt_state_unknown; - if ( mlt_service_has_input( this ) ) - state |= mlt_state_providing; - if ( mlt_service_has_output( this ) ) - state |= mlt_state_connected; - if ( state != ( mlt_state_providing | mlt_state_connected ) ) - state |= mlt_state_dormant; - return state; -} - -/** Get the maximum number of inputs accepted. - Returns: -1 for many, 0 for none or n for fixed. -*/ - -int mlt_service_accepts_input( mlt_service this ) -{ - if ( this->accepts_input == NULL ) - return -1; - else - return this->accepts_input( this ); -} - -/** Get the maximum number of outputs accepted. -*/ - -int mlt_service_accepts_output( mlt_service this ) -{ - if ( this->accepts_output == NULL ) - return 1; - else - return this->accepts_output( this ); -} - -/** Determines if this service has input -*/ - -int mlt_service_has_input( mlt_service this ) -{ - if ( this->has_input == NULL ) - return 1; - else - return this->has_input( this ); -} - -/** Determine if this service has output -*/ - -int mlt_service_has_output( mlt_service this ) -{ - mlt_service_base *base = this->private; - if ( this->has_output == NULL ) - return base->out != NULL; - else - return this->has_output( this ); -} - -/** Check if the service is active. -*/ - -int mlt_service_is_active( mlt_service this ) -{ - return !( mlt_service_get_state( this ) & mlt_state_dormant ); -} - -/** Obtain a frame to pass on. -*/ - -static int service_get_frame( mlt_service this, mlt_frame_ptr frame, int index ) -{ - mlt_service_base *base = this->private; - if ( index < base->count ) - { - mlt_service producer = base->in[ index ]; - if ( producer != NULL ) - return mlt_service_get_frame( producer, frame, index ); - } - *frame = mlt_frame_init( ); - return 0; -} - -int mlt_service_get_frame( mlt_service this, mlt_frame_ptr frame, int index ) -{ - return this->get_frame( this, frame, index ); -} - -/** Close the service. -*/ - -void mlt_service_close( mlt_service this ) -{ - mlt_service_base *base = this->private; - free( base->in ); - free( base ); - mlt_properties_close( &this->parent ); -} - diff --git a/mlt/src/framework/mlt_service.h b/mlt/src/framework/mlt_service.h deleted file mode 100644 index 8ad43a8..0000000 --- a/mlt/src/framework/mlt_service.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * mlt_service.h -- interface for all service classes - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_SERVICE_H_ -#define _MLT_SERVICE_H_ - -#include "mlt_properties.h" - -/** State of a service. - - Note that a service may be dormant even though it's fully connected, - providing or consuming. -*/ - -typedef enum -{ - mlt_state_unknown = 0, - mlt_state_dormant = 1, - mlt_state_connected = 2, - mlt_state_providing = 4, - mlt_state_consuming = 8 -} -mlt_service_state; - -/** The interface definition for all services. -*/ - -struct mlt_service_s -{ - // We're extending properties here - struct mlt_properties_s parent; - - // Protected virtual - int ( *accepts_input )( mlt_service this ); - int ( *accepts_output )( mlt_service this ); - int ( *has_input )( mlt_service this ); - int ( *has_output )( mlt_service this ); - int ( *get_frame )( mlt_service this, mlt_frame_ptr frame, int index ); - - // Private data - void *private; - void *child; -}; - -/** The public API. -*/ - -extern int mlt_service_init( mlt_service this, void *child ); -extern mlt_properties mlt_service_properties( mlt_service this ); -extern int mlt_service_connect_producer( mlt_service this, mlt_service producer, int index ); -extern mlt_service_state mlt_service_get_state( mlt_service this ); -extern void mlt_service_close( mlt_service this ); - -extern int mlt_service_accepts_input( mlt_service this ); -extern int mlt_service_accepts_output( mlt_service this ); -extern int mlt_service_has_input( mlt_service this ); -extern int mlt_service_has_output( mlt_service this ); -extern int mlt_service_get_frame( mlt_service this, mlt_frame_ptr frame, int index ); -extern int mlt_service_is_active( mlt_service this ); -extern mlt_service mlt_service_get_producer( mlt_service this ); - -#endif - diff --git a/mlt/src/framework/mlt_tractor.c b/mlt/src/framework/mlt_tractor.c deleted file mode 100644 index f68079a..0000000 --- a/mlt/src/framework/mlt_tractor.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * mlt_tractor.c -- tractor service class - * 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 program 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. - * - * 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. - */ - -#include "config.h" - -#include "mlt_tractor.h" -#include "mlt_frame.h" -#include "mlt_multitrack.h" - -#include -#include -#include - -/** Private structure. -*/ - -struct mlt_tractor_s -{ - struct mlt_producer_s parent; - mlt_service producer; -}; - -/** Forward references to static methods. -*/ - -static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int track ); - -/** Constructor for the tractor. - - TODO: thread this service... -*/ - -mlt_tractor mlt_tractor_init( ) -{ - mlt_tractor this = calloc( sizeof( struct mlt_tractor_s ), 1 ); - if ( this != NULL ) - { - mlt_producer producer = &this->parent; - if ( mlt_producer_init( producer, this ) == 0 ) - { - producer->get_frame = producer_get_frame; - mlt_properties_set( mlt_producer_properties( producer ), "resource", "" ); - mlt_properties_set( mlt_producer_properties( producer ), "mlt_type", "mlt_producer" ); - mlt_properties_set( mlt_producer_properties( producer ), "mlt_service", "tractor" ); - } - else - { - free( this ); - this = NULL; - } - } - return this; -} - -/** Get the service object associated to the tractor. -*/ - -mlt_service mlt_tractor_service( mlt_tractor this ) -{ - return mlt_producer_service( &this->parent ); -} - -/** Get the producer object associated to the tractor. -*/ - -mlt_producer mlt_tractor_producer( mlt_tractor this ) -{ - return &this->parent; -} - -/** Get the properties object associated to the tractor. -*/ - -mlt_properties mlt_tractor_properties( mlt_tractor this ) -{ - return mlt_producer_properties( &this->parent ); -} - -/** Connect the tractor. -*/ - -int mlt_tractor_connect( mlt_tractor this, mlt_service producer ) -{ - int ret = mlt_service_connect_producer( mlt_tractor_service( this ), producer, 0 ); - - // This is the producer we're going to connect to - if ( ret == 0 ) - this->producer = producer; - - return ret; -} - -/** Get the next frame. - - TODO: This should be reading a pump being populated by the thread... -*/ - -static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int track ) -{ - mlt_tractor this = parent->child; - - // We only respond to the first track requests - if ( track == 0 && this->producer != NULL ) - { - int i = 0; - int looking = 1; - int done = 0; - mlt_frame temp = NULL; - mlt_frame store[ 10 ]; - int count = 0; - - // Get the properties of the parent producer - mlt_properties properties = mlt_producer_properties( parent ); - - // Try to obtain the multitrack associated to the tractor - mlt_multitrack multitrack = mlt_properties_get_data( properties, "multitrack", NULL ); - - // If we don't have one, we're in trouble... - if ( multitrack != NULL ) - { - mlt_producer target = mlt_multitrack_producer( multitrack ); - mlt_producer_seek( target, mlt_producer_frame( parent ) ); - mlt_producer_set_speed( target, mlt_producer_get_speed( parent ) ); - } - else - { - fprintf( stderr, "tractor without a multitrack!!\n" ); - } - - // Loop through each of the tracks we're harvesting - for ( i = 0; !done; i ++ ) - { - // Get a frame from the producer - mlt_service_get_frame( this->producer, &temp, i ); - - // Check for last track - done = mlt_properties_get_int( mlt_frame_properties( temp ), "last_track" ); - - // Handle the frame - if ( done && looking ) - { - // Use this as output if we don't have one already - *frame = temp; - } - else if ( ( !mlt_frame_is_test_card( temp ) || !mlt_frame_is_test_audio( temp ) ) && looking && - mlt_producer_frame( parent ) == mlt_frame_get_position( temp ) ) - { - *frame = temp; - looking = 0; - } - else - { - // We store all other frames for now - store[ count ++ ] = temp; - } - } - - // Now place all the unused frames on to the properties (will be destroyed automatically) - while ( count -- ) - { - mlt_properties frame_properties = mlt_frame_properties( *frame ); - char label[ 30 ]; - sprintf( label, "tractor_%d", count ); - while ( mlt_properties_get_data( frame_properties, label, NULL ) != NULL ) - strcat( label, "+" ); - mlt_properties_set_data( frame_properties, label, store[ count ], 0, ( mlt_destructor )mlt_frame_close, NULL ); - } - - // Prepare the next frame - mlt_producer_prepare_next( parent ); - - // Indicate our found status - return 0; - } - else - { - // Generate a test card - *frame = mlt_frame_init( ); - return 0; - } -} - -/** Close the tractor. -*/ - -void mlt_tractor_close( mlt_tractor this ) -{ - mlt_producer_close( &this->parent ); - free( this ); -} - diff --git a/mlt/src/framework/mlt_tractor.h b/mlt/src/framework/mlt_tractor.h deleted file mode 100644 index b6576ec..0000000 --- a/mlt/src/framework/mlt_tractor.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * mlt_tractor.h -- tractor service class - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_TRACTOR_H_ -#define _MLT_TRACTOR_H_ - -#include "mlt_producer.h" - -extern mlt_tractor mlt_tractor_init( ); -extern mlt_service mlt_tractor_service( mlt_tractor this ); -extern mlt_producer mlt_tractor_producer( mlt_tractor this ); -extern mlt_properties mlt_tractor_properties( mlt_tractor this ); -extern int mlt_tractor_connect( mlt_tractor this, mlt_service service ); -extern void mlt_tractor_close( mlt_tractor this ); - -#endif diff --git a/mlt/src/framework/mlt_transition.c b/mlt/src/framework/mlt_transition.c deleted file mode 100644 index b4024fb..0000000 --- a/mlt/src/framework/mlt_transition.c +++ /dev/null @@ -1,223 +0,0 @@ -/* - * mlt_transition.c -- abstraction for all transition services - * 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 program 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. - * - * 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. - */ - -#include "config.h" - -#include "mlt_transition.h" -#include "mlt_frame.h" - -#include -#include -#include - -/** Forward references. -*/ - -static int transition_get_frame( mlt_service this, mlt_frame_ptr frame, int index ); - -/** Constructor. -*/ - -int mlt_transition_init( mlt_transition this, void *child ) -{ - mlt_service service = &this->parent; - memset( this, 0, sizeof( struct mlt_transition_s ) ); - this->child = child; - if ( mlt_service_init( service, this ) == 0 ) - { - mlt_properties properties = mlt_transition_properties( this ); - - service->get_frame = transition_get_frame; - - mlt_properties_set_position( properties, "in", 0 ); - mlt_properties_set_position( properties, "out", 0 ); - mlt_properties_set_int( properties, "a_track", 0 ); - mlt_properties_set_int( properties, "b_track", 1 ); - - return 0; - } - return 1; -} - -/** Get the service associated to the transition. -*/ - -mlt_service mlt_transition_service( mlt_transition this ) -{ - return &this->parent; -} - -/** Get the properties interface. -*/ - -mlt_properties mlt_transition_properties( mlt_transition this ) -{ - return mlt_service_properties( mlt_transition_service( this ) ); -} - -/** Connect this transition with a producers a and b tracks. -*/ - -int mlt_transition_connect( mlt_transition this, mlt_service producer, int a_track, int b_track ) -{ - int ret = mlt_service_connect_producer( &this->parent, producer, a_track ); - if ( ret == 0 ) - { - mlt_properties properties = mlt_transition_properties( this ); - this->producer = producer; - mlt_properties_set_int( properties, "a_track", a_track ); - mlt_properties_set_int( properties, "b_track", b_track ); - } - return ret; -} - -/** Set the in and out points. -*/ - -void mlt_transition_set_in_and_out( mlt_transition this, mlt_position in, mlt_position out ) -{ - mlt_properties properties = mlt_transition_properties( this ); - mlt_properties_set_position( properties, "in", in ); - mlt_properties_set_position( properties, "out", out ); -} - -/** Get the index of the a track. -*/ - -int mlt_transition_get_a_track( mlt_transition this ) -{ - return mlt_properties_get_int( mlt_transition_properties( this ), "a_track" ); -} - -/** Get the index of the b track. -*/ - -int mlt_transition_get_b_track( mlt_transition this ) -{ - return mlt_properties_get_int( mlt_transition_properties( this ), "b_track" ); -} - -/** Get the in point. -*/ - -mlt_position mlt_transition_get_in( mlt_transition this ) -{ - return mlt_properties_get_position( mlt_transition_properties( this ), "in" ); -} - -/** Get the out point. -*/ - -mlt_position mlt_transition_get_out( mlt_transition this ) -{ - return mlt_properties_get_position( mlt_transition_properties( this ), "out" ); -} - -/** Process the frame. - - If we have no process method (unlikely), we simply return the a_frame unmolested. -*/ - -static mlt_frame transition_process( mlt_transition this, mlt_frame a_frame, mlt_frame b_frame ) -{ - if ( this->process == NULL ) - return a_frame; - else - return this->process( this, a_frame, b_frame ); -} - -/** Get a frame from this filter. - - The logic is complex here. A transition is applied to frames on the a and b tracks - specified in the connect method above. Since all frames are obtained via this - method for all tracks, we have to take special care that we only obtain the a and - b frames once - we do this on the first call to get a frame from either a or b. - - After that, we have 2 cases to resolve: - - 1) if the track is the a_track and we're in the time zone, then we need to call the - process method to do the effect on the frame and remember we've passed it on - otherwise, we pass on the a_frame unmolested; - 2) For all other tracks, we get the frames on demand. -*/ - -static int transition_get_frame( mlt_service service, mlt_frame_ptr frame, int index ) -{ - mlt_transition this = service->child; - - mlt_properties properties = mlt_transition_properties( this ); - - int a_track = mlt_properties_get_int( properties, "a_track" ); - int b_track = mlt_properties_get_int( properties, "b_track" ); - mlt_position in = mlt_properties_get_position( properties, "in" ); - mlt_position out = mlt_properties_get_position( properties, "out" ); - - // Fetch a and b frames together... - if ( ( index == a_track || index == b_track ) && !( this->a_held || this->b_held ) ) - { - mlt_service_get_frame( this->producer, &this->a_frame, a_track ); - mlt_service_get_frame( this->producer, &this->b_frame, b_track ); - this->a_held = 1; - this->b_held = 1; - } - - // Special case track processing - if ( index == a_track ) - { - // Determine if we're in the right time zone - mlt_position position = mlt_frame_get_position( this->a_frame ); - if ( position >= in && position <= out ) - { - // Process the transition - *frame = transition_process( this, this->a_frame, this->b_frame ); - this->a_held = 0; - } - else - { - // Pass on the 'a frame' and remember that we've done it - *frame = this->a_frame; - this->a_held = 0; - } - return 0; - } - if ( index == b_track ) - { - // Pass on the 'b frame' and remember that we've done it - *frame = this->b_frame; - this->b_held = 0; - return 0; - } - else - { - // Pass through - return mlt_service_get_frame( this->producer, frame, index ); - } -} - -/** Close the transition. -*/ - -void mlt_transition_close( mlt_transition this ) -{ - if ( this->close != NULL ) - this->close( this ); - else - mlt_service_close( &this->parent ); -} diff --git a/mlt/src/framework/mlt_transition.h b/mlt/src/framework/mlt_transition.h deleted file mode 100644 index 1dad6c1..0000000 --- a/mlt/src/framework/mlt_transition.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * mlt_transition.h -- abstraction for all transition services - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_TRANSITION_H_ -#define _MLT_TRANSITION_H_ - -#include "mlt_service.h" - -/** The interface definition for all transitions. -*/ - -struct mlt_transition_s -{ - // We're implementing service here - struct mlt_service_s parent; - - // public virtual - void ( *close )( mlt_transition ); - - // protected transition method - mlt_frame ( *process )( mlt_transition, mlt_frame, mlt_frame ); - - // Protected - void *child; - - // track and in/out points - mlt_service producer; - - // Private - mlt_frame a_frame; - mlt_frame b_frame; - int a_held; - int b_held; -}; - -/** Public final methods -*/ - -extern int mlt_transition_init( mlt_transition this, void *child ); -extern mlt_service mlt_transition_service( mlt_transition this ); -extern mlt_properties mlt_transition_properties( mlt_transition this ); -extern int mlt_transition_connect( mlt_transition this, mlt_service producer, int a_track, int b_track ); -extern void mlt_transition_set_in_and_out( mlt_transition this, mlt_position in, mlt_position out ); -extern int mlt_transition_get_a_track( mlt_transition this ); -extern int mlt_transition_get_b_track( mlt_transition this ); -extern mlt_position mlt_transition_get_in( mlt_transition this ); -extern mlt_position mlt_transition_get_out( mlt_transition this ); -extern void mlt_transition_close( mlt_transition this ); - -#endif diff --git a/mlt/src/framework/mlt_types.h b/mlt/src/framework/mlt_types.h deleted file mode 100644 index 26bae3d..0000000 --- a/mlt/src/framework/mlt_types.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * mlt_types.h -- provides forward definitions of all public types - * 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 program 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. - * - * 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. - */ - -#ifndef _MLT_TYPES_H_ -#define _MLT_TYPES_H_ - -#include - -typedef enum -{ - mlt_whence_relative_start, - mlt_whence_relative_current, - mlt_whence_relative_end -} -mlt_whence; - -typedef int64_t mlt_position; -typedef struct mlt_frame_s *mlt_frame, **mlt_frame_ptr; -typedef struct mlt_properties_s *mlt_properties; -typedef struct mlt_service_s *mlt_service; -typedef struct mlt_producer_s *mlt_producer; -typedef struct mlt_manager_s *mlt_manager; -typedef struct mlt_playlist_s *mlt_playlist; -typedef struct mlt_multitrack_s *mlt_multitrack; -typedef struct mlt_filter_s *mlt_filter; -typedef struct mlt_transition_s *mlt_transition; -typedef struct mlt_tractor_s *mlt_tractor; -typedef struct mlt_field_s *mlt_field; -typedef struct mlt_consumer_s *mlt_consumer; - -typedef void ( *mlt_destructor )( void * ); -typedef char *( *mlt_serialiser )( void *, int length ); - -#define MLT_SERVICE(x) ( ( mlt_service )( x ) ) -#define MLT_PRODUCER(x) ( ( mlt_producer )( x ) ) -#define MLT_MULTITRACK(x) ( ( mlt_multitrack )( x ) ) -#define MLT_PLAYLIST(x) ( ( mlt_playlist )( x ) ) -#define MLT_TRACTOR(x) ( ( mlt_tractor )( x ) ) -#define MLT_FILTER(x) ( ( mlt_filter )( x ) ) -#define MLT_TRANSITION(x) ( ( mlt_transition )( x ) ) - -#endif diff --git a/mlt/src/humperdink/Makefile b/mlt/src/humperdink/Makefile deleted file mode 100644 index 53f2f96..0000000 --- a/mlt/src/humperdink/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -TARGET = humperdink - -OBJS = client.o \ - io.o \ - remote.o - -CFLAGS = -I .. -Wall -g -D_FILE_OFFSET_BITS=64 -pthread -rdynamic - -LDFLAGS = -L ../valerie -lvalerie - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/humperdink/client.c b/mlt/src/humperdink/client.c deleted file mode 100644 index 0705c14..0000000 --- a/mlt/src/humperdink/client.c +++ /dev/null @@ -1,1026 +0,0 @@ -/* - * client.c -- dv1394d client demo - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -/* System header files */ -#include -#include -#include - -/* Application header files */ -#include "client.h" -#include "io.h" - -/** Clip navigation enumeration. -*/ - -typedef enum -{ - absolute, - relative -} -dv_demo_whence; - -/** Function prototype for menu handling. -*/ - -typedef valerie_error_code (*demo_function)( dv_demo ); - -/** The menu structure. -*/ - -typedef struct -{ - char *description; - struct menu_item - { - char *option; - demo_function function; - } - array[ 50 ]; -} -*dv_demo_menu, dv_demo_menu_t; - -/** Forward reference to menu runner. -*/ - -extern valerie_error_code dv_demo_run_menu( dv_demo, dv_demo_menu ); - -/** Foward references. -*/ - -extern valerie_error_code dv_demo_list_nodes( dv_demo ); -extern valerie_error_code dv_demo_add_unit( dv_demo ); -extern valerie_error_code dv_demo_select_unit( dv_demo ); -extern valerie_error_code dv_demo_execute( dv_demo ); -extern valerie_error_code dv_demo_load( dv_demo ); -extern valerie_error_code dv_demo_transport( dv_demo ); -static void *dv_demo_status_thread( void * ); - -/** Connected menu definition. -*/ - -dv_demo_menu_t connected_menu = -{ - "Connected Menu", - { - { "Add Unit", dv_demo_add_unit }, - { "Select Unit", dv_demo_select_unit }, - { "Command Shell", dv_demo_execute }, - { NULL, NULL } - } -}; - -/** Initialise the demo structure. -*/ - -dv_demo dv_demo_init( valerie_parser parser ) -{ - dv_demo this = malloc( sizeof( dv_demo_t ) ); - if ( this != NULL ) - { - int index = 0; - memset( this, 0, sizeof( dv_demo_t ) ); - strcpy( this->last_directory, "/" ); - for ( index = 0; index < 4; index ++ ) - { - this->queues[ index ].unit = index; - this->queues[ index ].position = -1; - } - this->parser = parser; - } - return this; -} - -/** Display a status record. -*/ - -void dv_demo_show_status( dv_demo demo, valerie_status status ) -{ - if ( status->unit == demo->selected_unit && demo->showing ) - { - char temp[ 1024 ] = ""; - - sprintf( temp, "U%d ", demo->selected_unit ); - - switch( status->status ) - { - case unit_offline: - strcat( temp, "offline " ); - break; - case unit_undefined: - strcat( temp, "undefined " ); - break; - case unit_not_loaded: - strcat( temp, "unloaded " ); - break; - case unit_stopped: - strcat( temp, "stopped " ); - break; - case unit_playing: - strcat( temp, "playing " ); - break; - case unit_paused: - strcat( temp, "paused " ); - break; - case unit_disconnected: - strcat( temp, "disconnect" ); - break; - default: - strcat( temp, "unknown " ); - break; - } - - sprintf( temp + strlen( temp ), " %9lld %9lld %9lld ", status->in, status->position, status->out ); - strcat( temp, status->clip ); - - printf( "%-80.80s\r", temp ); - fflush( stdout ); - } -} - -/** Determine action to carry out as dictated by the client unit queue. -*/ - -void dv_demo_queue_action( dv_demo demo, valerie_status status ) -{ - dv_demo_queue queue = &demo->queues[ status->unit ]; - - /* SPECIAL CASE STATUS NOTIFICATIONS TO IGNORE */ - - /* When we've issued a LOAD on the previous notification, then ignore this one. */ - if ( queue->ignore ) - { - queue->ignore --; - return; - } - - if ( queue->mode && status->status != unit_offline && queue->head != queue->tail ) - { - if ( ( status->position >= status->out && status->speed > 0 ) || status->status == unit_not_loaded ) - { - queue->position = ( queue->position + 1 ) % 50; - if ( queue->position == queue->tail ) - queue->position = queue->head; - valerie_unit_load( demo->dv_status, status->unit, queue->list[ queue->position ] ); - if ( status->status == unit_not_loaded ) - valerie_unit_play( demo->dv, queue->unit ); - queue->ignore = 1; - } - else if ( ( status->position <= status->in && status->speed < 0 ) || status->status == unit_not_loaded ) - { - if ( queue->position == -1 ) - queue->position = queue->head; - valerie_unit_load( demo->dv_status, status->unit, queue->list[ queue->position ] ); - if ( status->status == unit_not_loaded ) - valerie_unit_play( demo->dv, queue->unit ); - queue->position = ( queue->position - 1 ) % 50; - queue->ignore = 1; - } - } -} - -/** Status thread. -*/ - -static void *dv_demo_status_thread( void *arg ) -{ - dv_demo demo = arg; - valerie_status_t status; - valerie_notifier notifier = valerie_get_notifier( demo->dv_status ); - - while ( !demo->terminated ) - { - if ( valerie_notifier_wait( notifier, &status ) != -1 ) - { - dv_demo_queue_action( demo, &status ); - dv_demo_show_status( demo, &status ); - if ( status.status == unit_disconnected ) - demo->disconnected = 1; - } - } - - return NULL; -} - -/** Turn on/off status display. -*/ - -void dv_demo_change_status( dv_demo demo, int flag ) -{ - if ( demo->disconnected && flag ) - { - valerie_error_code error = valerie_connect( demo->dv ); - if ( error == valerie_ok ) - demo->disconnected = 0; - else - beep(); - } - - if ( flag ) - { - valerie_status_t status; - valerie_notifier notifier = valerie_get_notifier( demo->dv ); - valerie_notifier_get( notifier, &status, demo->selected_unit ); - demo->showing = 1; - dv_demo_show_status( demo, &status ); - } - else - { - demo->showing = 0; - printf( "%-80.80s\r", " " ); - fflush( stdout ); - } -} - -/** Add a unit. -*/ - -valerie_error_code dv_demo_add_unit( dv_demo demo ) -{ - valerie_error_code error = valerie_ok; - valerie_nodes nodes = valerie_nodes_init( demo->dv ); - valerie_units units = valerie_units_init( demo->dv ); - - if ( valerie_nodes_count( nodes ) != -1 && valerie_units_count( units ) != -1 ) - { - char pressed; - valerie_node_entry_t node; - valerie_unit_entry_t unit; - int node_index = 0; - int unit_index = 0; - - printf( "Select a Node\n\n" ); - - for ( node_index = 0; node_index < valerie_nodes_count( nodes ); node_index ++ ) - { - valerie_nodes_get( nodes, node_index, &node ); - printf( "%d: %s - %s ", node_index + 1, node.guid, node.name ); - for ( unit_index = 0; unit_index < valerie_units_count( units ); unit_index ++ ) - { - valerie_units_get( units, unit_index, &unit ); - if ( !strcmp( unit.guid, node.guid ) ) - printf( "[U%d] ", unit.unit ); - } - printf( "\n" ); - } - - printf( "0. Exit\n\n" ); - - printf( "Node: " ); - - while ( ( pressed = get_keypress( ) ) != '0' ) - { - node_index = pressed - '1'; - if ( node_index >= 0 && node_index < valerie_nodes_count( nodes ) ) - { - int unit; - printf( "%c\n\n", pressed ); - valerie_nodes_get( nodes, node_index, &node ); - if ( valerie_unit_add( demo->dv, node.guid, &unit ) == valerie_ok ) - { - printf( "Unit added as U%d\n", unit ); - demo->selected_unit = unit; - } - else - { - int index = 0; - valerie_response response = valerie_get_last_response( demo->dv ); - printf( "Failed to add unit:\n\n" ); - for( index = 1; index < valerie_response_count( response ) - 1; index ++ ) - printf( "%s\n", valerie_response_get_line( response, index ) ); - } - printf( "\n" ); - wait_for_any_key( NULL ); - break; - } - else - { - beep( ); - } - } - } - else - { - printf( "Invalid response from the server.\n\n" ); - wait_for_any_key( NULL ); - } - - valerie_nodes_close( nodes ); - valerie_units_close( units ); - - return error; -} - -/** Select a unit. -*/ - -valerie_error_code dv_demo_select_unit( dv_demo demo ) -{ - int terminated = 0; - int refresh = 1; - - while ( !terminated ) - { - valerie_units units = valerie_units_init( demo->dv ); - - if ( valerie_units_count( units ) > 0 ) - { - valerie_unit_entry_t unit; - int index = 0; - char key = '\0'; - - if ( refresh ) - { - printf( "Select a Unit\n\n" ); - - for ( index = 0; index < valerie_units_count( units ); index ++ ) - { - valerie_units_get( units, index, &unit ); - printf( "%d: U%d - %s [%s]\n", index + 1, - unit.unit, - unit.guid, - unit.online ? "online" : "offline" ); - } - printf( "0: Exit\n\n" ); - - printf( "Unit [%d]: ", demo->selected_unit + 1 ); - refresh = 0; - } - - key = get_keypress( ); - - if ( key == '\r' ) - key = demo->selected_unit + '1'; - - if ( key != '0' ) - { - if ( key >= '1' && key < '1' + valerie_units_count( units ) ) - { - demo->selected_unit = key - '1'; - printf( "%c\n\n", key ); - dv_demo_load( demo ); - refresh = 1; - } - else - { - beep( ); - } - } - else - { - printf( "0\n\n" ); - terminated = 1; - } - } - else if ( valerie_units_count( units ) == 0 ) - { - printf( "No units added - add a unit first\n\n" ); - dv_demo_add_unit( demo ); - } - else - { - printf( "Unable to obtain Unit List.\n" ); - terminated = 1; - } - - valerie_units_close( units ); - } - - return valerie_ok; -} - -/** Execute an arbitrary command. -*/ - -valerie_error_code dv_demo_execute( dv_demo demo ) -{ - valerie_error_code error = valerie_ok; - char command[ 10240 ]; - int terminated = 0; - - printf( "DV1394D Shell\n" ); - printf( "Enter an empty command to exit.\n\n" ); - - while ( !terminated ) - { - terminated = 1; - printf( "Command> " ); - - if ( chomp( get_string( command, 10240, "" ) ) != NULL ) - { - if ( strcmp( command, "" ) ) - { - int index = 0; - valerie_response response = NULL; - error = valerie_execute( demo->dv, 10240, command ); - printf( "\n" ); - response = valerie_get_last_response( demo->dv ); - for ( index = 0; index < valerie_response_count( response ); index ++ ) - { - char *line = valerie_response_get_line( response, index ); - printf( "%4d: %s\n", index, line ); - } - printf( "\n" ); - terminated = 0; - } - } - } - - printf( "\n" ); - - return error; -} - -/** Add a file to the queue. -*/ - -valerie_error_code dv_demo_queue_add( dv_demo demo, dv_demo_queue queue, char *file ) -{ - valerie_status_t status; - valerie_notifier notifier = valerie_get_notifier( demo->dv ); - - if ( ( queue->tail + 1 ) % 50 == queue->head ) - queue->head = ( queue->head + 1 ) % 50; - strcpy( queue->list[ queue->tail ], file ); - queue->tail = ( queue->tail + 1 ) % 50; - - valerie_notifier_get( notifier, &status, queue->unit ); - valerie_notifier_put( notifier, &status ); - - return valerie_ok; -} - -/** Basic queue maintenance and status reports. -*/ - -valerie_error_code dv_demo_queue_maintenance( dv_demo demo, dv_demo_queue queue ) -{ - printf( "Queue Maintenance for Unit %d\n\n", queue->unit ); - - if ( !queue->mode ) - { - char ch; - printf( "Activate queueing? [Y] " ); - ch = get_keypress( ); - if ( ch == 'y' || ch == 'Y' || ch == '\r' ) - queue->mode = 1; - printf( "\n\n" ); - } - - if ( queue->mode ) - { - int terminated = 0; - int last_position = -2; - - term_init( ); - - while ( !terminated ) - { - int first = ( queue->position + 1 ) % 50; - int index = first; - - if ( first == queue->tail ) - index = first = queue->head; - - if ( queue->head == queue->tail ) - { - if ( last_position == -2 ) - { - printf( "Queue is empty\n" ); - printf( "\n" ); - printf( "0 = exit, t = turn off queueing\n\n" ); - last_position = -1; - } - } - else if ( last_position != queue->position ) - { - printf( "Order of play\n\n" ); - - do - { - printf( "%c%02d: %s\n", index == first ? '*' : ' ', index, queue->list[ index ] + 1 ); - index = ( index + 1 ) % 50; - if ( index == queue->tail ) - index = queue->head; - } - while( index != first ); - - printf( "\n" ); - printf( "0 = exit, t = turn off queueing, c = clear queue\n\n" ); - last_position = queue->position; - } - - dv_demo_change_status( demo, 1 ); - - switch( term_read( ) ) - { - case -1: - break; - case '0': - terminated = 1; - break; - case 't': - terminated = 1; - queue->mode = 0; - break; - case 'c': - queue->head = queue->tail = 0; - queue->position = -1; - last_position = -2; - break; - } - - dv_demo_change_status( demo, 0 ); - } - - term_exit( ); - } - - return valerie_ok; -} - -/** Load a file to the selected unit. Horrible function - sorry :-/. Not a good - demo.... -*/ - -valerie_error_code dv_demo_load( dv_demo demo ) -{ - valerie_error_code error = valerie_ok; - int terminated = 0; - int refresh = 1; - int start = 0; - - strcpy( demo->current_directory, demo->last_directory ); - - term_init( ); - - while ( !terminated ) - { - valerie_dir dir = valerie_dir_init( demo->dv, demo->current_directory ); - - if ( valerie_dir_count( dir ) == -1 ) - { - printf( "Invalid directory - retrying %s\n", demo->last_directory ); - valerie_dir_close( dir ); - dir = valerie_dir_init( demo->dv, demo->last_directory ); - if ( valerie_dir_count( dir ) == -1 ) - { - printf( "Invalid directory - going back to /\n" ); - valerie_dir_close( dir ); - dir = valerie_dir_init( demo->dv, "/" ); - strcpy( demo->current_directory, "/" ); - } - else - { - strcpy( demo->current_directory, demo->last_directory ); - } - } - - terminated = valerie_dir_count( dir ) == -1; - - if ( !terminated ) - { - int index = 0; - int selected = 0; - int max = 9; - int end = 0; - - end = valerie_dir_count( dir ); - - strcpy( demo->last_directory, demo->current_directory ); - - while ( !selected && !terminated ) - { - valerie_dir_entry_t entry; - int pressed; - - if ( refresh ) - { - char *action = "Load & Play"; - if ( demo->queues[ demo->selected_unit ].mode ) - action = "Queue"; - printf( "%s from %s\n\n", action, demo->current_directory ); - if ( strcmp( demo->current_directory, "/" ) ) - printf( "-: Parent directory\n" ); - for ( index = start; index < end && ( index - start ) < max; index ++ ) - { - valerie_dir_get( dir, index, &entry ); - printf( "%d: %s\n", index - start + 1, entry.name ); - } - while ( ( index ++ % 9 ) != 0 ) - printf( "\n" ); - printf( "\n" ); - if ( start + max < end ) - printf( "space = more files" ); - else if ( end > max ) - printf( "space = return to start of list" ); - if ( start > 0 ) - printf( ", b = previous files" ); - printf( "\n" ); - printf( "0 = abort, t = transport, x = execute command, q = queue maintenance\n\n" ); - refresh = 0; - } - - dv_demo_change_status( demo, 1 ); - - pressed = term_read( ); - switch( pressed ) - { - case -1: - break; - case '0': - terminated = 1; - break; - case 'b': - refresh = start - max >= 0; - if ( refresh ) - start = start - max; - break; - case ' ': - refresh = start + max < end; - if ( refresh ) - { - start = start + max; - } - else if ( end > max ) - { - start = 0; - refresh = 1; - } - break; - case '-': - if ( strcmp( demo->current_directory, "/" ) ) - { - selected = 1; - ( *strrchr( demo->current_directory, '/' ) ) = '\0'; - ( *( strrchr( demo->current_directory, '/' ) + 1 ) ) = '\0'; - } - break; - case 't': - dv_demo_change_status( demo, 0 ); - term_exit( ); - dv_demo_transport( demo ); - term_init( ); - selected = 1; - break; - case 'x': - dv_demo_change_status( demo, 0 ); - term_exit( ); - dv_demo_execute( demo ); - term_init( ); - selected = 1; - break; - case 'q': - dv_demo_change_status( demo, 0 ); - term_exit( ); - dv_demo_queue_maintenance( demo, &demo->queues[ demo->selected_unit ] ); - term_init( ); - selected = 1; - break; - default: - if ( pressed >= '1' && pressed <= '9' ) - { - if ( ( start + pressed - '1' ) < end ) - { - valerie_dir_get( dir, start + pressed - '1', &entry ); - selected = 1; - strcat( demo->current_directory, entry.name ); - } - } - break; - } - - dv_demo_change_status( demo, 0 ); - } - - valerie_dir_close( dir ); - } - - if ( !terminated && demo->current_directory[ strlen( demo->current_directory ) - 1 ] != '/' ) - { - if ( demo->queues[ demo->selected_unit ].mode == 0 ) - { - error = valerie_unit_load( demo->dv, demo->selected_unit, demo->current_directory ); - valerie_unit_play( demo->dv, demo->selected_unit ); - } - else - { - dv_demo_queue_add( demo, &demo->queues[ demo->selected_unit ], demo->current_directory ); - printf( "File %s added to queue.\n", demo->current_directory ); - } - strcpy( demo->current_directory, demo->last_directory ); - refresh = 0; - } - else - { - refresh = 1; - start = 0; - } - } - - term_exit( ); - - return error; -} - -/** Set the in point of the clip on the select unit. -*/ - -valerie_error_code dv_demo_set_in( dv_demo demo ) -{ - int position = 0; - valerie_status_t status; - valerie_notifier notifier = valerie_parser_get_notifier( demo->parser ); - valerie_notifier_get( notifier, &status, demo->selected_unit ); - position = status.position; - return valerie_unit_set_in( demo->dv, demo->selected_unit, position ); -} - -/** Set the out point of the clip on the selected unit. -*/ - -valerie_error_code dv_demo_set_out( dv_demo demo ) -{ - int position = 0; - valerie_status_t status; - valerie_notifier notifier = valerie_parser_get_notifier( demo->parser ); - valerie_notifier_get( notifier, &status, demo->selected_unit ); - position = status.position; - return valerie_unit_set_out( demo->dv, demo->selected_unit, position ); -} - -/** Clear the in and out points on the selected unit. -*/ - -valerie_error_code dv_demo_clear_in_out( dv_demo demo ) -{ - return valerie_unit_clear_in_out( demo->dv, demo->selected_unit ); -} - -/** Goto a user specified frame on the selected unit. -*/ - -valerie_error_code dv_demo_goto( dv_demo demo ) -{ - int frame = 0; - printf( "Frame: " ); - if ( get_int( &frame, 0 ) ) - return valerie_unit_goto( demo->dv, demo->selected_unit, frame ); - return valerie_ok; -} - -/** Manipulate playback on the selected unit. -*/ - -valerie_error_code dv_demo_transport( dv_demo demo ) -{ - valerie_error_code error = valerie_ok; - int refresh = 1; - int terminated = 0; - valerie_status_t status; - valerie_notifier notifier = valerie_get_notifier( demo->dv ); - - while ( !terminated ) - { - if ( refresh ) - { - printf( " +----+ +------+ +----+ +------+ +---+ +-----+ +------+ +-----+ +---+ \n" ); - printf( " |1=-5| |2=-2.5| |3=-1| |4=-0.5| |5=1| |6=0.5| |7=1.25| |8=2.5| |9=5| \n" ); - printf( " +----+ +------+ +----+ +------+ +---+ +-----+ +------+ +-----+ +---+ \n" ); - printf( "\n" ); - printf( "+----------------------------------------------------------------------+\n" ); - printf( "| 0 = quit, x = eXecute, 'space' = pause |\n" ); - printf( "| g = goto a frame, q = queue maintenance |\n" ); - printf( "| h = step -1, j = end of clip, k = start of clip, l = step 1 |\n" ); - printf( "| eof handling: p = pause, r = repeat, t = terminate |\n" ); - printf( "| i = set in point, o = set out point, c = clear in/out |\n" ); - printf( "| u = use point settings, d = don't use point settings |\n" ); - printf( "+----------------------------------------------------------------------+\n" ); - printf( "\n" ); - term_init( ); - refresh = 0; - } - - dv_demo_change_status( demo, 1 ); - - switch( term_read( ) ) - { - case '0': - terminated = 1; - break; - case -1: - break; - case ' ': - error = valerie_unit_pause( demo->dv, demo->selected_unit ); - break; - case '1': - error = valerie_unit_play_at_speed( demo->dv, demo->selected_unit, -5000 ); - break; - case '2': - error = valerie_unit_play_at_speed( demo->dv, demo->selected_unit, -2500 ); - break; - case '3': - error = valerie_unit_play_at_speed( demo->dv, demo->selected_unit, -1000 ); - break; - case '4': - error = valerie_unit_play_at_speed( demo->dv, demo->selected_unit, -500 ); - break; - case '5': - error = valerie_unit_play( demo->dv, demo->selected_unit ); - break; - case '6': - error = valerie_unit_play_at_speed( demo->dv, demo->selected_unit, 500 ); - break; - case '7': - error = valerie_unit_play_at_speed( demo->dv, demo->selected_unit, 1250 ); - break; - case '8': - error = valerie_unit_play_at_speed( demo->dv, demo->selected_unit, 2500 ); - break; - case '9': - error = valerie_unit_play_at_speed( demo->dv, demo->selected_unit, 5000 ); - break; - case 's': - error = valerie_unit_goto( demo->dv, demo->selected_unit, 0 ); - break; - case 'h': - error = valerie_unit_step( demo->dv, demo->selected_unit, -1 ); - break; - case 'j': - valerie_notifier_get( notifier, &status, demo->selected_unit ); - error = valerie_unit_goto( demo->dv, demo->selected_unit, status.tail_out ); - break; - case 'k': - valerie_notifier_get( notifier, &status, demo->selected_unit ); - error = valerie_unit_goto( demo->dv, demo->selected_unit, status.in ); - break; - case 'l': - error = valerie_unit_step( demo->dv, demo->selected_unit, 1 ); - break; - case 'p': - error = valerie_unit_set( demo->dv, demo->selected_unit, "eof", "pause" ); - break; - case 'r': - error = valerie_unit_set( demo->dv, demo->selected_unit, "eof", "loop" ); - break; - case 't': - error = valerie_unit_set( demo->dv, demo->selected_unit, "eof", "stop" ); - break; - case 'i': - error = dv_demo_set_in( demo ); - break; - case 'o': - error = dv_demo_set_out( demo ); - break; - case 'g': - dv_demo_change_status( demo, 0 ); - term_exit( ); - error = dv_demo_goto( demo ); - refresh = 1; - break; - case 'c': - error = dv_demo_clear_in_out( demo ); - break; - case 'u': - error = valerie_unit_set( demo->dv, demo->selected_unit, "points", "use" ); - break; - case 'd': - error = valerie_unit_set( demo->dv, demo->selected_unit, "points", "ignore" ); - break; - case 'x': - dv_demo_change_status( demo, 0 ); - term_exit( ); - dv_demo_execute( demo ); - refresh = 1; - break; - case 'q': - dv_demo_change_status( demo, 0 ); - term_exit( ); - dv_demo_queue_maintenance( demo, &demo->queues[ demo->selected_unit ] ); - refresh = 1; - break; - } - - dv_demo_change_status( demo, 0 ); - } - - term_exit( ); - - return error; -} - -/** Recursive menu execution. -*/ - -valerie_error_code dv_demo_run_menu( dv_demo demo, dv_demo_menu menu ) -{ - char *items = "123456789abcdefghijklmnopqrstuvwxyz"; - int refresh_menu = 1; - int terminated = 0; - int item_count = 0; - int item_selected = 0; - int index = 0; - char key; - - while( !terminated ) - { - - if ( refresh_menu ) - { - printf( "%s\n\n", menu->description ); - for ( index = 0; menu->array[ index ].option != NULL; index ++ ) - printf( "%c: %s\n", items[ index ], menu->array[ index ].option ); - printf( "0: Exit\n\n" ); - printf( "Select Option: " ); - refresh_menu = 0; - item_count = index; - } - - key = get_keypress( ); - - if ( demo->disconnected && key != '0' ) - { - valerie_error_code error = valerie_connect( demo->dv ); - if ( error == valerie_ok ) - demo->disconnected = 0; - else - beep(); - } - - if ( !demo->disconnected || key == '0' ) - { - item_selected = strchr( items, key ) - items; - - if ( key == '0' ) - { - printf( "%c\n\n", key ); - terminated = 1; - } - else if ( item_selected >= 0 && item_selected < item_count ) - { - printf( "%c\n\n", key ); - menu->array[ item_selected ].function( demo ); - refresh_menu = 1; - } - else - { - beep( ); - } - } - } - - return valerie_ok; -} - -/** Entry point for main menu. -*/ - -void dv_demo_run( dv_demo this ) -{ - this->dv = valerie_init( this->parser ); - this->dv_status = valerie_init( this->parser ); - if ( valerie_connect( this->dv ) == valerie_ok ) - { - pthread_create( &this->thread, NULL, dv_demo_status_thread, this ); - dv_demo_run_menu( this, &connected_menu ); - this->terminated = 1; - pthread_join( this->thread, NULL ); - this->terminated = 0; - } - else - { - printf( "Unable to connect." ); - wait_for_any_key( "" ); - } - - valerie_close( this->dv_status ); - valerie_close( this->dv ); - - printf( "Demo Exit.\n" ); -} - -/** Close the demo structure. -*/ - -void dv_demo_close( dv_demo demo ) -{ - free( demo ); -} - diff --git a/mlt/src/humperdink/client.h b/mlt/src/humperdink/client.h deleted file mode 100644 index 9490360..0000000 --- a/mlt/src/humperdink/client.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * client.h -- dv1394d client demo - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -#ifndef _DEMO_CLIENT_H_ -#define _DEMO_CLIENT_H_ - -#include -#include -#include - -/** Queue for unit playback -*/ - -typedef struct -{ - int mode; - int unit; - int position; - int head; - int tail; - char list[ 50 ][ PATH_MAX + NAME_MAX ]; - int ignore; -} -*dv_demo_queue, dv_demo_queue_t; - -/** Structure for storing app state. -*/ - -typedef struct -{ - int disconnected; - valerie_parser parser; - valerie dv; - valerie dv_status; - int selected_unit; - char current_directory[ 512 ]; - char last_directory[ 512 ]; - int showing; - int terminated; - pthread_t thread; - dv_demo_queue_t queues[ MAX_UNITS ]; -} -*dv_demo, dv_demo_t; - -extern dv_demo dv_demo_init( valerie_parser ); -extern void dv_demo_run( dv_demo ); -extern void dv_demo_close( dv_demo ); - -#endif diff --git a/mlt/src/humperdink/io.c b/mlt/src/humperdink/io.c deleted file mode 100644 index b9e92f2..0000000 --- a/mlt/src/humperdink/io.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * io.c -- dv1394d client demo input/output - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -/* System header files */ -#include -#include -#include -#include -#include -#include - -/* Application header files */ -#include "io.h" - -char *chomp( char *input ) -{ - if ( input != NULL ) - { - int length = strlen( input ); - if ( length && input[ length - 1 ] == '\n' ) - input[ length - 1 ] = '\0'; - if ( length > 1 && input[ length - 2 ] == '\r' ) - input[ length - 2 ] = '\0'; - } - return input; -} - -char *trim( char *input ) -{ - if ( input != NULL ) - { - int length = strlen( input ); - int first = 0; - while( first < length && isspace( input[ first ] ) ) - first ++; - memmove( input, input + first, length - first + 1 ); - length = length - first; - while ( length > 0 && isspace( input[ length - 1 ] ) ) - input[ -- length ] = '\0'; - } - return input; -} - -char *strip_quotes( char *input ) -{ - if ( input != NULL ) - { - char *ptr = strrchr( input, '\"' ); - if ( ptr != NULL ) - *ptr = '\0'; - if ( input[ 0 ] == '\"' ) - strcpy( input, input + 1 ); - } - return input; -} - -char *get_string( char *output, int maxlength, char *use ) -{ - char *value = NULL; - strcpy( output, use ); - if ( trim( chomp( fgets( output, maxlength, stdin ) ) ) != NULL ) - { - if ( !strcmp( output, "" ) ) - strcpy( output, use ); - value = output; - } - return value; -} - -int *get_int( int *output, int use ) -{ - int *value = NULL; - char temp[ 132 ]; - *output = use; - if ( trim( chomp( fgets( temp, 132, stdin ) ) ) != NULL ) - { - if ( strcmp( temp, "" ) ) - *output = atoi( temp ); - value = output; - } - return value; -} - -/** This stores the previous settings -*/ - -static struct termios oldtty; -static int mode = 0; - -/** This is called automatically on application exit to restore the - previous tty settings. -*/ - -void term_exit(void) -{ - if ( mode == 1 ) - { - tcsetattr( 0, TCSANOW, &oldtty ); - mode = 0; - } -} - -/** Init terminal so that we can grab keys without blocking. -*/ - -void term_init( ) -{ - struct termios tty; - - tcgetattr( 0, &tty ); - oldtty = tty; - - tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); - tty.c_oflag |= OPOST; - tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN); - tty.c_cflag &= ~(CSIZE|PARENB); - tty.c_cflag |= CS8; - tty.c_cc[ VMIN ] = 1; - tty.c_cc[ VTIME ] = 0; - - tcsetattr( 0, TCSANOW, &tty ); - - mode = 1; - - atexit( term_exit ); -} - -/** Check for a keypress without blocking infinitely. - Returns: ASCII value of keypress or -1 if no keypress detected. -*/ - -int term_read( ) -{ - int n = 1; - unsigned char ch; - struct timeval tv; - fd_set rfds; - - FD_ZERO( &rfds ); - FD_SET( 0, &rfds ); - tv.tv_sec = 1; - tv.tv_usec = 0; - n = select( 1, &rfds, NULL, NULL, &tv ); - if (n > 0) - { - n = read( 0, &ch, 1 ); - tcflush( 0, TCIFLUSH ); - if (n == 1) - return ch; - return n; - } - return -1; -} - -char get_keypress( ) -{ - char value = '\0'; - int pressed = 0; - - fflush( stdout ); - - term_init( ); - while ( ( pressed = term_read( ) ) == -1 ) ; - term_exit( ); - - value = (char)pressed; - - return value; -} - -void wait_for_any_key( char *message ) -{ - if ( message == NULL ) - printf( "Press any key to continue: " ); - else - printf( "%s", message ); - - get_keypress( ); - - printf( "\n\n" ); -} - -void beep( ) -{ - printf( "%c", 7 ); - fflush( stdout ); -} diff --git a/mlt/src/humperdink/io.h b/mlt/src/humperdink/io.h deleted file mode 100644 index 6c4b609..0000000 --- a/mlt/src/humperdink/io.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * io.h -- dv1394d client demo input/output - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -#ifndef _DEMO_IO_H_ -#define _DEMO_IO_H_ - -extern char *chomp( char * ); -extern char *trim( char * ); -extern char *strip_quotes( char * ); -extern char *get_string( char *, int, char * ); -extern int *get_int( int *, int ); -extern void term_init( ); -extern int term_read( ); -extern void term_exit( ); -extern char get_keypress( ); -extern void wait_for_any_key( char * ); -extern void beep( ); - -#endif diff --git a/mlt/src/humperdink/remote.c b/mlt/src/humperdink/remote.c deleted file mode 100644 index 9306b21..0000000 --- a/mlt/src/humperdink/remote.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * remote.c -- Remote dv1394d client demo - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -/* System header files */ -#include -#include - -/* dv1394d header files */ -#include - -/* Application header files */ -#include "client.h" -#include "io.h" - -/** Connect to a remote server. -*/ - -static valerie_parser create_parser( ) -{ - char server[ 132 ]; - int port; - valerie_parser parser = NULL; - - printf( "Connecting to a Server\n\n" ); - - printf( "Server [localhost]: " ); - - if ( get_string( server, sizeof( server ), "localhost" ) != NULL ) - { - printf( "Port [5250]: " ); - - if ( get_int( &port, 5250 ) != NULL ) - parser = valerie_parser_init_remote( server, port ); - } - - printf( "\n" ); - - return parser; -} - -/** Main function. -*/ - -int main( int argc, char **argv ) -{ - valerie_parser parser = create_parser( ); - - if ( parser != NULL ) - { - dv_demo demo = dv_demo_init( parser ); - dv_demo_run( demo ); - dv_demo_close( demo ); - valerie_parser_close( parser ); - } - - return 0; -} diff --git a/mlt/src/inigo/Makefile b/mlt/src/inigo/Makefile deleted file mode 100644 index 78e7cfa..0000000 --- a/mlt/src/inigo/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -TARGET = inigo - -OBJS = inigo.o \ - io.o - -CFLAGS = -I .. -Wall -g -D_FILE_OFFSET_BITS=64 -pthread -rdynamic - -LDFLAGS = -L ../framework -lmlt - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/inigo/configure b/mlt/src/inigo/configure deleted file mode 100755 index e69de29..0000000 diff --git a/mlt/src/inigo/inigo.c b/mlt/src/inigo/inigo.c deleted file mode 100644 index cfef4fd..0000000 --- a/mlt/src/inigo/inigo.c +++ /dev/null @@ -1,282 +0,0 @@ -#include -#include -#include - -#include - -#include "io.h" - -static void transport_action( mlt_producer producer, char *value ) -{ - mlt_properties properties = mlt_producer_properties( producer ); - mlt_multitrack multitrack = mlt_properties_get_data( properties, "multitrack", NULL ); - - if ( strlen( value ) == 1 ) - { - switch( value[ 0 ] ) - { - case 'q': - mlt_properties_set_int( properties, "done", 1 ); - break; - case '0': - mlt_producer_set_speed( producer, 1 ); - mlt_producer_seek( producer, 0 ); - break; - case '1': - mlt_producer_set_speed( producer, -10 ); - break; - case '2': - mlt_producer_set_speed( producer, -5 ); - break; - case '3': - mlt_producer_set_speed( producer, -2 ); - break; - case '4': - mlt_producer_set_speed( producer, -1 ); - break; - case '5': - mlt_producer_set_speed( producer, 0 ); - break; - case '6': - case ' ': - mlt_producer_set_speed( producer, 1 ); - break; - case '7': - mlt_producer_set_speed( producer, 2 ); - break; - case '8': - mlt_producer_set_speed( producer, 5 ); - break; - case '9': - mlt_producer_set_speed( producer, 10 ); - break; - case 'd': - if ( multitrack != NULL ) - { - int i = 0; - mlt_position last = -1; - for ( i = 0; 1; i ++ ) - { - mlt_position time = mlt_multitrack_clip( multitrack, mlt_whence_relative_start, i ); - if ( time == last ) - break; - last = time; - fprintf( stderr, "%d: %lld\n", i, time ); - } - fprintf( stderr, "Current Position: %lld\n", mlt_producer_position( producer ) ); - } - break; - - case 'g': - if ( multitrack != NULL ) - { - mlt_position time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, 0 ); - mlt_producer_seek( producer, time ); - } - break; - case 'H': - if ( producer != NULL ) - { - mlt_position position = mlt_producer_position( producer ); - mlt_producer_seek( producer, position - ( mlt_producer_get_fps( producer ) * 60 ) ); - } - break; - case 'h': - if ( producer != NULL ) - { - mlt_position position = mlt_producer_position( producer ); - mlt_producer_set_speed( producer, 0 ); - mlt_producer_seek( producer, position - 1 ); - } - break; - case 'j': - if ( multitrack != NULL ) - { - mlt_position time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, 1 ); - mlt_producer_seek( producer, time ); - } - break; - case 'k': - if ( multitrack != NULL ) - { - mlt_position time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, -1 ); - mlt_producer_seek( producer, time ); - } - break; - case 'l': - if ( producer != NULL ) - { - mlt_position position = mlt_producer_position( producer ); - mlt_producer_set_speed( producer, 0 ); - mlt_producer_seek( producer, position + 1 ); - } - break; - case 'L': - if ( producer != NULL ) - { - mlt_position position = mlt_producer_position( producer ); - mlt_producer_seek( producer, position + ( mlt_producer_get_fps( producer ) * 60 ) ); - } - break; - } - } -} - -static mlt_consumer create_consumer( char *id, mlt_producer producer ) -{ - char *arg = strchr( id, ':' ); - if ( arg != NULL ) - *arg ++ = '\0'; - mlt_consumer consumer = mlt_factory_consumer( id, arg ); - if ( consumer != NULL ) - { - mlt_properties properties = mlt_consumer_properties( consumer ); - mlt_properties_set_data( properties, "transport_callback", transport_action, 0, NULL, NULL ); - mlt_properties_set_data( properties, "transport_producer", producer, 0, NULL, NULL ); - } - return consumer; -} - -static void transport( mlt_producer producer ) -{ - mlt_properties properties = mlt_producer_properties( producer ); - - term_init( ); - - fprintf( stderr, "+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+\n" ); - fprintf( stderr, "|1=-10| |2= -5| |3= -2| |4= -1| |5= 0| |6= 1| |7= 2| |8= 5| |9= 10|\n" ); - fprintf( stderr, "+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+\n" ); - - fprintf( stderr, "+---------------------------------------------------------------------+\n" ); - fprintf( stderr, "| H = back 1 minute, L = forward 1 minute |\n" ); - fprintf( stderr, "| h = previous frame, l = next frame |\n" ); - fprintf( stderr, "| g = start of clip, j = next clip, k = previous clip |\n" ); - fprintf( stderr, "| 0 = restart, q = quit, space = play |\n" ); - fprintf( stderr, "+---------------------------------------------------------------------+\n" ); - - while( mlt_properties_get_int( properties, "done" ) == 0 ) - { - int value = term_read( ); - if ( value != -1 ) - transport_action( producer, ( char * )&value ); - } -} - -int main( int argc, char **argv ) -{ - int i; - mlt_consumer consumer = NULL; - mlt_producer inigo = NULL; - FILE *store = NULL; - char *name = NULL; - - // Construct the factory - mlt_factory_init( getenv( "MLT_REPOSITORY" ) ); - - for ( i = 1; i < argc; i ++ ) - { - if ( !strcmp( argv[ i ], "-serialise" ) ) - { - name = argv[ ++ i ]; - if ( strstr( name, ".inigo" ) ) - store = fopen( name, "w" ); - } - } - - // Get inigo producer - inigo = mlt_factory_producer( "inigo", &argv[ 1 ] ); - - if ( argc > 1 && inigo != NULL && mlt_producer_get_length( inigo ) > 0 ) - { - // Get inigo's properties - mlt_properties inigo_props = mlt_producer_properties( inigo ); - - // Get the field service from inigo - mlt_field field = mlt_properties_get_data( inigo_props, "field", 0 ); - - // Get the last group - mlt_properties group = mlt_properties_get_data( inigo_props, "group", 0 ); - - // Parse the arguments - for ( i = 1; i < argc; i ++ ) - { - if ( !strcmp( argv[ i ], "-consumer" ) ) - { - consumer = create_consumer( argv[ ++ i ], inigo ); - while ( argv[ i + 1 ] != NULL && strstr( argv[ i + 1 ], "=" ) ) - mlt_properties_parse( group, argv[ ++ i ] ); - } - else if ( !strcmp( argv[ i ], "-serialise" ) ) - { - i ++; - } - else - { - if ( store != NULL ) - fprintf( store, "%s\n", argv[ i ] ); - - i ++; - - while ( argv[ i ] != NULL && argv[ i ][ 0 ] != '-' ) - { - if ( store != NULL ) - fprintf( store, "%s\n", argv[ i ] ); - i += 1; - } - - i --; - } - } - - // If we have no consumer, default to sdl - if ( store == NULL && consumer == NULL ) - consumer = create_consumer( "sdl", inigo ); - - if ( consumer != NULL && store == NULL ) - { - // Apply group settings - mlt_properties properties = mlt_consumer_properties( consumer ); - mlt_properties_inherit( properties, group ); - - // Connect consumer to tractor - mlt_consumer_connect( consumer, mlt_field_service( field ) ); - - // Start the consumer - mlt_consumer_start( consumer ); - - // Transport functionality - transport( inigo ); - - // Stop the consumer - mlt_consumer_stop( consumer ); - } - else if ( store != NULL ) - { - fprintf( stderr, "Project saved as %s.\n", name ); - fclose( store ); - } - } - else - { - fprintf( stderr, "Usage: inigo [ -group [ name=value ]* ]\n" - " [ -consumer id[:arg] [ name=value ]* ]\n" - " [ -filter id[:arg] [ name=value ] * ]\n" - " [ -transition id[:arg] [ name=value ] * ]\n" - " [ -blank frames ]\n" - " [ -track ]\n" - " [ producer [ name=value ] * ]+\n" ); - } - - // Close the consumer - if ( consumer != NULL ) - mlt_consumer_close( consumer ); - - // Close the producer - if ( inigo != NULL ) - mlt_producer_close( inigo ); - - // Close the factory - mlt_factory_close( ); - - return 0; -} diff --git a/mlt/src/inigo/io.c b/mlt/src/inigo/io.c deleted file mode 100644 index 431003d..0000000 --- a/mlt/src/inigo/io.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * io.c -- dv1394d client demo input/output - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* System header files */ -#include -#include -#include -#include -#include -#include - -/* Application header files */ -#include "io.h" - -char *chomp( char *input ) -{ - if ( input != NULL ) - { - int length = strlen( input ); - if ( length && input[ length - 1 ] == '\n' ) - input[ length - 1 ] = '\0'; - if ( length > 1 && input[ length - 2 ] == '\r' ) - input[ length - 2 ] = '\0'; - } - return input; -} - -char *trim( char *input ) -{ - if ( input != NULL ) - { - int length = strlen( input ); - int first = 0; - while( first < length && isspace( input[ first ] ) ) - first ++; - memmove( input, input + first, length - first + 1 ); - length = length - first; - while ( length > 0 && isspace( input[ length - 1 ] ) ) - input[ -- length ] = '\0'; - } - return input; -} - -char *strip_quotes( char *input ) -{ - if ( input != NULL ) - { - char *ptr = strrchr( input, '\"' ); - if ( ptr != NULL ) - *ptr = '\0'; - if ( input[ 0 ] == '\"' ) - strcpy( input, input + 1 ); - } - return input; -} - -char *get_string( char *output, int maxlength, char *use ) -{ - char *value = NULL; - strcpy( output, use ); - if ( trim( chomp( fgets( output, maxlength, stdin ) ) ) != NULL ) - { - if ( !strcmp( output, "" ) ) - strcpy( output, use ); - value = output; - } - return value; -} - -int *get_int( int *output, int use ) -{ - int *value = NULL; - char temp[ 132 ]; - *output = use; - if ( trim( chomp( fgets( temp, 132, stdin ) ) ) != NULL ) - { - if ( strcmp( temp, "" ) ) - *output = atoi( temp ); - value = output; - } - return value; -} - -/** This stores the previous settings -*/ - -static struct termios oldtty; -static int mode = 0; - -/** This is called automatically on application exit to restore the - previous tty settings. -*/ - -void term_exit(void) -{ - if ( mode == 1 ) - { - tcsetattr( 0, TCSANOW, &oldtty ); - mode = 0; - } -} - -/** Init terminal so that we can grab keys without blocking. -*/ - -void term_init( ) -{ - struct termios tty; - - tcgetattr( 0, &tty ); - oldtty = tty; - - tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); - tty.c_oflag |= OPOST; - tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN); - tty.c_cflag &= ~(CSIZE|PARENB); - tty.c_cflag |= CS8; - tty.c_cc[ VMIN ] = 1; - tty.c_cc[ VTIME ] = 0; - - tcsetattr( 0, TCSANOW, &tty ); - - mode = 1; - - atexit( term_exit ); -} - -/** Check for a keypress without blocking infinitely. - Returns: ASCII value of keypress or -1 if no keypress detected. -*/ - -int term_read( ) -{ - int n = 1; - unsigned char ch; - struct timeval tv; - fd_set rfds; - - FD_ZERO( &rfds ); - FD_SET( 0, &rfds ); - tv.tv_sec = 0; - tv.tv_usec = 250; - n = select( 1, &rfds, NULL, NULL, &tv ); - if (n > 0) - { - n = read( 0, &ch, 1 ); - tcflush( 0, TCIFLUSH ); - if (n == 1) - return ch; - return n; - } - return -1; -} - -char get_keypress( ) -{ - char value = '\0'; - int pressed = 0; - - fflush( stdout ); - - term_init( ); - while ( ( pressed = term_read( ) ) == -1 ) ; - term_exit( ); - - value = (char)pressed; - - return value; -} - -void wait_for_any_key( char *message ) -{ - if ( message == NULL ) - printf( "Press any key to continue: " ); - else - printf( "%s", message ); - - get_keypress( ); - - printf( "\n\n" ); -} - -void beep( ) -{ - printf( "%c", 7 ); - fflush( stdout ); -} diff --git a/mlt/src/inigo/io.h b/mlt/src/inigo/io.h deleted file mode 100644 index f97e69e..0000000 --- a/mlt/src/inigo/io.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * io.h -- dv1394d client demo input/output - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -#ifndef _DEMO_IO_H_ -#define _DEMO_IO_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern char *chomp( char * ); -extern char *trim( char * ); -extern char *strip_quotes( char * ); -extern char *get_string( char *, int, char * ); -extern int *get_int( int *, int ); -extern void term_init( ); -extern int term_read( ); -extern void term_exit( ); -extern char get_keypress( ); -extern void wait_for_any_key( char * ); -extern void beep( ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/miracle/Makefile b/mlt/src/miracle/Makefile deleted file mode 100644 index 3bda183..0000000 --- a/mlt/src/miracle/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -TARGET = miracle - -APP_OBJS = miracle.o - -LIB_OBJS = miracle_log.o \ - miracle_server.o \ - miracle_connection.o \ - miracle_local.o \ - miracle_unit.o \ - miracle_commands.o \ - miracle_unit_commands.o - -OBJS = $(APP_OBJS) $(LIB_OBJS) - -CFLAGS = -I .. -Wall -g -D_FILE_OFFSET_BITS=64 -pthread -rdynamic - -LDFLAGS = -L ../valerie -lvalerie -L ../framework -lmlt - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(APP_OBJS) libmiracle.so - $(CC) -o $@ $(APP_OBJS) -L. -lmiracle $(LDFLAGS) - -libmiracle.so: $(LIB_OBJS) - $(CC) -shared -o $@ $(LIB_OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) libmiracle.so - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/miracle/configure b/mlt/src/miracle/configure deleted file mode 100755 index 1a24852..0000000 --- a/mlt/src/miracle/configure +++ /dev/null @@ -1 +0,0 @@ -#!/bin/sh diff --git a/mlt/src/miracle/miracle.c b/mlt/src/miracle/miracle.c deleted file mode 100644 index e3d26f4..0000000 --- a/mlt/src/miracle/miracle.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * miracle.c -- A DV over IEEE 1394 TCP Server - * - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Authors: - * Dan Dennedy - * 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 program 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. - * - * 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. - */ - -/* System header files */ -#include -#include -#include -#include -#include -#include - -#include - -/* Application header files */ -#include "miracle_server.h" -#include "miracle_log.h" - -/** Our dv server. -*/ - -static miracle_server server = NULL; - -/** atexit shutdown handler for the server. -*/ - -static void main_cleanup( ) -{ - miracle_server_shutdown( server ); -} - -/** Report usage and exit. -*/ - -void usage( char *app ) -{ - fprintf( stderr, "Usage: %s [-test] [-port NNNN]\n", app ); - exit( 0 ); -} - -/** The main function. -*/ - -int main( int argc, char **argv ) -{ - int error = 0; - int index = 0; - int background = 1; - struct timespec tm = { 5, 0 }; - - server = miracle_server_init( argv[ 0 ] ); - - for ( index = 1; index < argc; index ++ ) - { - if ( !strcmp( argv[ index ], "-port" ) ) - miracle_server_set_port( server, atoi( argv[ ++ index ] ) ); - else if ( !strcmp( argv[ index ], "-proxy" ) ) - miracle_server_set_proxy( server, argv[ ++ index ] ); - else if ( !strcmp( argv[ index ], "-test" ) ) - background = 0; - else - usage( argv[ 0 ] ); - } - - /* Optionally detatch ourselves from the controlling tty */ - - if ( background ) - { - if ( fork() ) - return 0; - setsid(); - miracle_log_init( log_syslog, LOG_INFO ); - } - else - { - miracle_log_init( log_stderr, LOG_DEBUG ); - } - - atexit( main_cleanup ); - - /* Execute the server */ - error = miracle_server_execute( server ); - - /* We need to wait until we're exited.. */ - while ( !server->shutdown ) - nanosleep( &tm, NULL ); - - return error; -} diff --git a/mlt/src/miracle/miracle_commands.c b/mlt/src/miracle/miracle_commands.c deleted file mode 100644 index 3a5db91..0000000 --- a/mlt/src/miracle/miracle_commands.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * global_commands.c - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "miracle_unit.h" -#include "miracle_commands.h" -#include "miracle_log.h" - -static miracle_unit g_units[MAX_UNITS]; - - -/** Return the miracle_unit given a numeric index. -*/ - -miracle_unit miracle_get_unit( int n ) -{ - if (n < MAX_UNITS) - return g_units[n]; - else - return NULL; -} - -/** Destroy the miracle_unit given its numeric index. -*/ - -void miracle_delete_unit( int n ) -{ - if (n < MAX_UNITS) - { - miracle_unit unit = miracle_get_unit(n); - if (unit != NULL) - { - miracle_unit_close( unit ); - g_units[ n ] = NULL; - miracle_log( LOG_NOTICE, "Deleted unit U%d.", n ); - } - } -} - -/** Destroy all allocated units on the server. -*/ - -void miracle_delete_all_units( void ) -{ - int i; - for (i = 0; i < MAX_UNITS; i++) - { - if ( miracle_get_unit(i) != NULL ) - { - miracle_unit_close( miracle_get_unit(i) ); - miracle_log( LOG_NOTICE, "Deleted unit U%d.", i ); - } - } -} - -/** Add a DV virtual vtr to the server. -*/ -response_codes miracle_add_unit( command_argument cmd_arg ) -{ - int i = 0; - for ( i = 0; i < MAX_UNITS; i ++ ) - if ( g_units[ i ] == NULL ) - break; - - if ( i < MAX_UNITS ) - { - char *arg = cmd_arg->argument; - g_units[ i ] = miracle_unit_init( i, arg ); - if ( g_units[ i ] != NULL ) - miracle_unit_set_notifier( g_units[ i ], valerie_parser_get_notifier( cmd_arg->parser ), cmd_arg->root_dir ); - return g_units[ i ] != NULL ? RESPONSE_SUCCESS : RESPONSE_ERROR; - } - - return RESPONSE_ERROR; -} - - -/** List all AV/C nodes on the bus. -*/ -response_codes miracle_list_nodes( command_argument cmd_arg ) -{ - response_codes error = RESPONSE_SUCCESS_N; - return error; -} - - -/** List units already added to server. -*/ -response_codes miracle_list_units( command_argument cmd_arg ) -{ - response_codes error = RESPONSE_SUCCESS_N; - int i = 0; - - for ( i = 0; i < MAX_UNITS; i ++ ) - { - miracle_unit unit = miracle_get_unit( i ); - if ( unit != NULL ) - { - mlt_properties properties = unit->properties; - char *constructor = mlt_properties_get( properties, "constructor" ); - int node = mlt_properties_get_int( properties, "node" ); - int online = !mlt_properties_get_int( properties, "offline" ); - valerie_response_printf( cmd_arg->response, 1024, "U%d %02d %s %d\n", i, node, constructor, online ); - } - } - - return error; -} - -static int filter_files( const struct dirent *de ) -{ - return de->d_name[ 0 ] != '.'; -} - -/** List clips in a directory. -*/ -response_codes miracle_list_clips( command_argument cmd_arg ) -{ - response_codes error = RESPONSE_BAD_FILE; - const char *dir_name = (const char*) cmd_arg->argument; - DIR *dir; - char fullname[1024]; - struct dirent **de = NULL; - int i, n; - - snprintf( fullname, 1023, "%s%s", cmd_arg->root_dir, dir_name ); - dir = opendir( fullname ); - if (dir != NULL) - { - struct stat info; - error = RESPONSE_SUCCESS_N; - n = scandir( fullname, &de, filter_files, alphasort ); - for (i = 0; i < n; i++ ) - { - snprintf( fullname, 1023, "%s%s/%s", cmd_arg->root_dir, dir_name, de[i]->d_name ); - if ( stat( fullname, &info ) == 0 && S_ISDIR( info.st_mode ) ) - valerie_response_printf( cmd_arg->response, 1024, "\"%s/\"\n", de[i]->d_name ); - } - for (i = 0; i < n; i++ ) - { - snprintf( fullname, 1023, "%s%s/%s", cmd_arg->root_dir, dir_name, de[i]->d_name ); - if ( lstat( fullname, &info ) == 0 && - ( S_ISREG( info.st_mode ) || S_ISLNK( info.st_mode ) || ( strstr( fullname, ".clip" ) && info.st_mode | S_IXUSR ) ) ) - valerie_response_printf( cmd_arg->response, 1024, "\"%s\" %llu\n", de[i]->d_name, (unsigned long long) info.st_size ); - free( de[ i ] ); - } - free( de ); - closedir( dir ); - valerie_response_write( cmd_arg->response, "\n", 1 ); - } - - return error; -} - -/** Set a server configuration property. -*/ - -response_codes miracle_set_global_property( command_argument cmd_arg ) -{ - char *key = (char*) cmd_arg->argument; - char *value = NULL; - - value = strchr( key, '=' ); - if (value == NULL) - return RESPONSE_OUT_OF_RANGE; - *value = 0; - value++; - miracle_log( LOG_DEBUG, "SET %s = %s", key, value ); - - if ( strncasecmp( key, "root", 1024) == 0 ) - { - int len = strlen(value); - int i; - - /* stop all units and unload clips */ - for (i = 0; i < MAX_UNITS; i++) - { - if (g_units[i] != NULL) - miracle_unit_terminate( g_units[i] ); - } - - /* set the property */ - strncpy( cmd_arg->root_dir, value, 1023 ); - - /* add a trailing slash if needed */ - if ( cmd_arg->root_dir[ len - 1 ] != '/') - { - cmd_arg->root_dir[ len ] = '/'; - cmd_arg->root_dir[ len + 1 ] = '\0'; - } - } - else - return RESPONSE_OUT_OF_RANGE; - - return RESPONSE_SUCCESS; -} - -/** Get a server configuration property. -*/ - -response_codes miracle_get_global_property( command_argument cmd_arg ) -{ - char *key = (char*) cmd_arg->argument; - - if ( strncasecmp( key, "root", 1024) == 0 ) - { - valerie_response_write( cmd_arg->response, cmd_arg->root_dir, strlen(cmd_arg->root_dir) ); - return RESPONSE_SUCCESS_1; - } - else - return RESPONSE_OUT_OF_RANGE; - - return RESPONSE_SUCCESS; -} - - diff --git a/mlt/src/miracle/miracle_commands.h b/mlt/src/miracle/miracle_commands.h deleted file mode 100644 index 9d79683..0000000 --- a/mlt/src/miracle/miracle_commands.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * global_commands.h - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - - -#ifndef _GLOBAL_COMMANDS_H_ -#define _GLOBAL_COMMANDS_H_ - -#include -#include "miracle_unit.h" -#include "miracle_connection.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern miracle_unit miracle_get_unit( int ); -extern void miracle_delete_unit( int ); -extern void miracle_delete_all_units( void ); -extern int miracle_unit_status( int n, valerie_status status, int root_offset ); -//extern void raw1394_start_service_threads( void ); -//extern void raw1394_stop_service_threads( void ); - -extern response_codes miracle_add_unit( command_argument ); -extern response_codes miracle_list_nodes( command_argument ); -extern response_codes miracle_list_units( command_argument ); -extern response_codes miracle_list_clips( command_argument ); -extern response_codes miracle_set_global_property( command_argument ); -extern response_codes miracle_get_global_property( command_argument ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/miracle/miracle_connection.c b/mlt/src/miracle/miracle_connection.c deleted file mode 100644 index 82a5b59..0000000 --- a/mlt/src/miracle/miracle_connection.c +++ /dev/null @@ -1,248 +0,0 @@ -/* - * miracle_connection.c -- DV Connection Handler - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* System header files */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -/* Application header files */ -#include "miracle_commands.h" -#include "miracle_connection.h" -#include "miracle_server.h" -#include "miracle_log.h" - -/** This is a generic replacement for fgets which operates on a file - descriptor. Unlike fgets, we can also specify a line terminator. Maximum - of (max - 1) chars can be read into buf from fd. If we reach the - end-of-file, *eof_chk is set to 1. -*/ - -int fdgetline( int fd, char *buf, int max, char line_terminator, int *eof_chk ) -{ - int count = 0; - char tmp [1]; - *eof_chk = 0; - - if (fd) - while (count < max - 1) { - if (read (fd, tmp, 1) > 0) { - if (tmp [0] != line_terminator) - buf [count++] = tmp [0]; - else - break; - -/* Is it an EOF character (ctrl-D, i.e. ascii 4)? If so we definitely want - to break. */ - - if (tmp [0] == 4) { - *eof_chk = 1; - break; - } - } else { - *eof_chk = 1; - break; - } - } - - buf [count] = '\0'; - - return count; -} - -static int connection_initiate( int ); -static int connection_send( int, valerie_response ); -static int connection_read( int, char *, int ); -static void connection_close( int ); - -static int connection_initiate( int fd ) -{ - int error = 0; - valerie_response response = valerie_response_init( ); - valerie_response_set_error( response, 100, "VTR Ready" ); - error = connection_send( fd, response ); - valerie_response_close( response ); - return error; -} - -static int connection_send( int fd, valerie_response response ) -{ - int error = 0; - int index = 0; - int code = valerie_response_get_error_code( response ); - - if ( code != -1 ) - { - int items = valerie_response_count( response ); - - if ( items == 0 ) - valerie_response_set_error( response, 500, "Unknown error" ); - - if ( code == 200 && items > 2 ) - valerie_response_set_error( response, 201, "OK" ); - else if ( code == 200 && items > 1 ) - valerie_response_set_error( response, 202, "OK" ); - - code = valerie_response_get_error_code( response ); - items = valerie_response_count( response ); - - for ( index = 0; !error && index < items; index ++ ) - { - char *line = valerie_response_get_line( response, index ); - int length = strlen( line ); - if ( length == 0 && index != valerie_response_count( response ) - 1 && write( fd, " ", 1 ) != 1 ) - error = -1; - else if ( length > 0 && write( fd, line, length ) != length ) - error = -1; - if ( write( fd, "\r\n", 2 ) != 2 ) - error = -1; - } - - if ( ( code == 201 || code == 500 ) && strcmp( valerie_response_get_line( response, items - 1 ), "" ) ) - write( fd, "\r\n", 2 ); - } - else - { - char *message = "500 Empty Response\r\n\r\n"; - write( fd, message, strlen( message ) ); - } - - return error; -} - -static int connection_read( int fd, char *command, int length ) -{ - int eof_chk; - int nchars = fdgetline( fd, command, length, '\n', &eof_chk ); - char *cr = strchr( command, '\r'); - if ( cr != NULL ) - cr[0] = '\0'; - if ( eof_chk || strncasecmp( command, "BYE", 3 ) == 0 ) - nchars = 0; - return nchars; -} - -int connection_status( int fd, valerie_notifier notifier ) -{ - int error = 0; - int index = 0; - valerie_status_t status; - char text[ 10240 ]; - valerie_socket socket = valerie_socket_init_fd( fd ); - - for ( index = 0; !error && index < MAX_UNITS; index ++ ) - { - valerie_notifier_get( notifier, &status, index ); - valerie_status_serialise( &status, text, sizeof( text ) ); - error = valerie_socket_write_data( socket, text, strlen( text ) ) != strlen( text ); - } - - while ( !error ) - { - if ( valerie_notifier_wait( notifier, &status ) == 0 ) - { - valerie_status_serialise( &status, text, sizeof( text ) ); - error = valerie_socket_write_data( socket, text, strlen( text ) ) != strlen( text ); - } - else - { - struct timeval tv = { 0, 0 }; - fd_set rfds; - - FD_ZERO( &rfds ); - FD_SET( fd, &rfds ); - - if ( select( socket->fd + 1, &rfds, NULL, NULL, &tv ) ) - error = 1; - } - } - - valerie_socket_close( socket ); - - return error; -} - -static void connection_close( int fd ) -{ - close( fd ); -} - -void *parser_thread( void *arg ) -{ - struct hostent *he; - connection_t *connection = arg; - char address[ 512 ]; - char command[ 1024 ]; - int fd = connection->fd; - valerie_parser parser = connection->parser; - valerie_response response = NULL; - - /* Get the connecting clients ip information */ - he = gethostbyaddr( (char *) &( connection->sin.sin_addr.s_addr ), sizeof(u_int32_t), AF_INET); - if ( he != NULL ) - strcpy( address, he->h_name ); - else - inet_ntop( AF_INET, &( connection->sin.sin_addr.s_addr), address, 32 ); - - miracle_log( LOG_NOTICE, "Connection established with %s (%d)", address, fd ); - - /* Execute the commands received. */ - if ( connection_initiate( fd ) == 0 ) - { - int error = 0; - - while( !error && connection_read( fd, command, 1024 ) ) - { - if ( strncmp( command, "STATUS", 6 ) ) - { - response = valerie_parser_execute( parser, command ); - miracle_log( LOG_INFO, "%s \"%s\" %d", address, command, valerie_response_get_error_code( response ) ); - error = connection_send( fd, response ); - valerie_response_close( response ); - } - else - { - error = connection_status( fd, valerie_parser_get_notifier( parser ) ); - } - } - } - - /* Free the resources associated with this connection. */ - connection_close( fd ); - - miracle_log( LOG_NOTICE, "Connection with %s (%d) closed", address, fd ); - - free( connection ); - - return NULL; -} diff --git a/mlt/src/miracle/miracle_connection.h b/mlt/src/miracle/miracle_connection.h deleted file mode 100644 index ce19115..0000000 --- a/mlt/src/miracle/miracle_connection.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * miracle_connection.h -- DV Connection Handler - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -#ifndef _DV_CONNECTION_H_ -#define _DV_CONNECTION_H_ - -#include -#include -#include - -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Connection structure -*/ - -typedef struct -{ - int fd; - struct sockaddr_in sin; - valerie_parser parser; -} -connection_t; - -/** Enumeration for responses. -*/ - -typedef enum -{ - RESPONSE_SUCCESS = 200, - RESPONSE_SUCCESS_N = 201, - RESPONSE_SUCCESS_1 = 202, - RESPONSE_UNKNOWN_COMMAND = 400, - RESPONSE_TIMEOUT = 401, - RESPONSE_MISSING_ARG = 402, - RESPONSE_INVALID_UNIT = 403, - RESPONSE_BAD_FILE = 404, - RESPONSE_OUT_OF_RANGE = 405, - RESPONSE_TOO_MANY_FILES = 406, - RESPONSE_ERROR = 500 -} -response_codes; - -/* the following struct is passed as the single argument - to all command callback functions */ - -typedef struct -{ - valerie_parser parser; - valerie_response response; - valerie_tokeniser tokeniser; - char *command; - int unit; - void *argument; - char *root_dir; -} -command_argument_t, *command_argument; - -/* A handler is defined as follows. */ -typedef int (*command_handler_t) ( command_argument ); - - -extern void *parser_thread( void *arg ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/miracle/miracle_local.c b/mlt/src/miracle/miracle_local.c deleted file mode 100644 index 501487a..0000000 --- a/mlt/src/miracle/miracle_local.c +++ /dev/null @@ -1,459 +0,0 @@ -/* - * miracle_local.c -- Local Miracle Parser - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* System header files */ -#include -#include -#include - -/* Valerie header files */ -#include - -/* MLT header files. */ -#include - -/* Application header files */ -#include "miracle_local.h" -#include "miracle_connection.h" -#include "miracle_commands.h" -#include "miracle_unit_commands.h" -#include "miracle_log.h" - -/** Private miracle_local structure. -*/ - -typedef struct -{ - valerie_parser parser; - char root_dir[1024]; -} -*miracle_local, miracle_local_t; - -/** Forward declarations. -*/ - -static valerie_response miracle_local_connect( miracle_local ); -static valerie_response miracle_local_execute( miracle_local, char * ); -static void miracle_local_close( miracle_local ); -response_codes miracle_help( command_argument arg ); -response_codes miracle_run( command_argument arg ); -response_codes miracle_shutdown( command_argument arg ); - -/** DV Parser constructor. -*/ - -valerie_parser miracle_parser_init_local( ) -{ - valerie_parser parser = malloc( sizeof( valerie_parser_t ) ); - miracle_local local = malloc( sizeof( miracle_local_t ) ); - - if ( parser != NULL ) - { - memset( parser, 0, sizeof( valerie_parser_t ) ); - - parser->connect = (parser_connect)miracle_local_connect; - parser->execute = (parser_execute)miracle_local_execute; - parser->close = (parser_close)miracle_local_close; - parser->real = local; - - if ( local != NULL ) - { - memset( local, 0, sizeof( miracle_local_t ) ); - local->parser = parser; - local->root_dir[0] = '/'; - } - - // Construct the factory - mlt_factory_init( getenv( "MLT_REPOSITORY" ) ); - } - return parser; -} - -/** response status code/message pair -*/ - -typedef struct -{ - int code; - char *message; -} -responses_t; - -/** response messages -*/ - -static responses_t responses [] = -{ - {RESPONSE_SUCCESS, "OK"}, - {RESPONSE_SUCCESS_N, "OK"}, - {RESPONSE_SUCCESS_1, "OK"}, - {RESPONSE_UNKNOWN_COMMAND, "Unknown command"}, - {RESPONSE_TIMEOUT, "Operation timed out"}, - {RESPONSE_MISSING_ARG, "Argument missing"}, - {RESPONSE_INVALID_UNIT, "Unit not found"}, - {RESPONSE_BAD_FILE, "Failed to locate or open clip"}, - {RESPONSE_OUT_OF_RANGE, "Argument value out of range"}, - {RESPONSE_TOO_MANY_FILES, "Too many files open"}, - {RESPONSE_ERROR, "Server Error"} -}; - -/** Argument types. -*/ - -typedef enum -{ - ATYPE_NONE, - ATYPE_FLOAT, - ATYPE_STRING, - ATYPE_INT -} -arguments_types; - -/** A command definition. -*/ - -typedef struct -{ -/* The command string corresponding to this operation (e.g. "play") */ - char *command; -/* The function associated with it */ - response_codes (*operation) ( command_argument ); -/* a boolean to indicate if this is a unit or global command - unit commands require a unit identifier as first argument */ - int is_unit; -/* What type is the argument (RTTI :-) ATYPE_whatever */ - int type; -/* online help information */ - char *help; -} -command_t; - -/* The following define the queue of commands available to the user. The - first entry is the name of the command (the string which must be typed), - the second command is the function associated with it, the third argument - is for the type of the argument, and the last argument specifies whether - this is something which should be handled immediately or whether it - should be queued (only robot motion commands need to be queued). */ - -static command_t vocabulary[] = -{ - {"BYE", NULL, 0, ATYPE_NONE, "Terminates the session. Units are not removed and task queue is not flushed."}, - {"HELP", miracle_help, 0, ATYPE_NONE, "Display this information!"}, - {"NLS", miracle_list_nodes, 0, ATYPE_NONE, "List the AV/C nodes on the 1394 bus."}, - {"UADD", miracle_add_unit, 0, ATYPE_STRING, "Create a new DV unit (virtual VTR) to transmit to receiver specified in GUID argument."}, - {"ULS", miracle_list_units, 0, ATYPE_NONE, "Lists the units that have already been added to the server."}, - {"CLS", miracle_list_clips, 0, ATYPE_STRING, "Lists the clips at directory name argument."}, - {"SET", miracle_set_global_property, 0, ATYPE_STRING, "Set a server configuration property."}, - {"GET", miracle_get_global_property, 0, ATYPE_STRING, "Get a server configuration property."}, - {"RUN", miracle_run, 0, ATYPE_STRING, "Run a batch file." }, - {"LIST", miracle_list, 1, ATYPE_NONE, "List the playlist associated to a unit."}, - {"LOAD", miracle_load, 1, ATYPE_STRING, "Load clip specified in absolute filename argument."}, - {"INSERT", miracle_insert, 1, ATYPE_STRING, "Insert a clip at the given clip index."}, - {"REMOVE", miracle_remove, 1, ATYPE_NONE, "Remove a clip at the given clip index."}, - {"CLEAN", miracle_clean, 1, ATYPE_NONE, "Clean a unit by removing all but the currently playing clip."}, - {"MOVE", miracle_move, 1, ATYPE_INT, "Move a clip to another clip index."}, - {"APND", miracle_append, 1, ATYPE_STRING, "Append a clip specified in absolute filename argument."}, - {"PLAY", miracle_play, 1, ATYPE_NONE, "Play a loaded clip at speed -2000 to 2000 where 1000 = normal forward speed."}, - {"STOP", miracle_stop, 1, ATYPE_NONE, "Stop a loaded and playing clip."}, - {"PAUSE", miracle_pause, 1, ATYPE_NONE, "Pause a playing clip."}, - {"REW", miracle_rewind, 1, ATYPE_NONE, "Rewind a unit. If stopped, seek to beginning of clip. If playing, play fast backwards."}, - {"FF", miracle_ff, 1, ATYPE_NONE, "Fast forward a unit. If stopped, seek to beginning of clip. If playing, play fast forwards."}, - {"STEP", miracle_step, 1, ATYPE_INT, "Step argument number of frames forward or backward."}, - {"GOTO", miracle_goto, 1, ATYPE_INT, "Jump to frame number supplied as argument."}, - {"SIN", miracle_set_in_point, 1, ATYPE_INT, "Set the IN point of the loaded clip to frame number argument. -1 = reset in point to 0"}, - {"SOUT", miracle_set_out_point, 1, ATYPE_INT, "Set the OUT point of the loaded clip to frame number argument. -1 = reset out point to maximum."}, - {"USTA", miracle_get_unit_status, 1, ATYPE_NONE, "Report information about the unit."}, - {"USET", miracle_set_unit_property, 1, ATYPE_STRING, "Set a unit configuration property."}, - {"UGET", miracle_get_unit_property, 1, ATYPE_STRING, "Get a unit configuration property."}, - {"XFER", miracle_transfer, 1, ATYPE_STRING, "Transfer the unit's clip to another unit specified as argument."}, - {"SHUTDOWN", miracle_shutdown, 0, ATYPE_NONE, "Shutdown the server."}, - {NULL, NULL, 0, ATYPE_NONE, NULL} -}; - -/** Usage message -*/ - -static char helpstr [] = - "Miracle -- A Multimedia Playout Server\n" - " Copyright (C) 2002-2003 Ushodaya Enterprises Limited\n" - " Authors:\n" - " Dan Dennedy \n" - " Charles Yates \n" - "Available commands:\n"; - -/** Lookup the response message for a status code. -*/ - -inline char *get_response_msg( int code ) -{ - int i = 0; - for ( i = 0; responses[ i ].message != NULL && code != responses[ i ].code; i ++ ) ; - return responses[ i ].message; -} - -/** Tell the user the miracle command set -*/ - -response_codes miracle_help( command_argument cmd_arg ) -{ - int i = 0; - - valerie_response_printf( cmd_arg->response, 10240, "%s", helpstr ); - - for ( i = 0; vocabulary[ i ].command != NULL; i ++ ) - valerie_response_printf( cmd_arg->response, 1024, - "%-10.10s%s\n", - vocabulary[ i ].command, - vocabulary[ i ].help ); - - valerie_response_printf( cmd_arg->response, 2, "\n" ); - - return RESPONSE_SUCCESS_N; -} - -/** Execute a batch file. -*/ - -response_codes miracle_run( command_argument cmd_arg ) -{ - valerie_response temp = valerie_parser_run( cmd_arg->parser, (char *)cmd_arg->argument ); - - if ( temp != NULL ) - { - int index = 0; - - valerie_response_set_error( cmd_arg->response, - valerie_response_get_error_code( temp ), - valerie_response_get_error_string( temp ) ); - - for ( index = 1; index < valerie_response_count( temp ); index ++ ) - valerie_response_printf( cmd_arg->response, 10240, "%s\n", valerie_response_get_line( temp, index ) ); - - valerie_response_close( temp ); - } - - return valerie_response_get_error_code( cmd_arg->response ); -} - -response_codes miracle_shutdown( command_argument cmd_arg ) -{ - exit( 0 ); - return RESPONSE_SUCCESS; -} - -/** Processes 'thread' id -*/ - -static pthread_t self; - -/* Signal handler to deal with various shutdown signals. Basically this - should clean up and power down the motor. Note that the death of any - child thread will kill all thrads. */ - -void signal_handler( int sig ) -{ - if ( pthread_equal( self, pthread_self( ) ) ) - { - -#ifdef _GNU_SOURCE - miracle_log( LOG_DEBUG, "Received %s - shutting down.", strsignal(sig) ); -#else - miracle_log( LOG_DEBUG, "Received signal %i - shutting down.", sig ); -#endif - - exit(EXIT_SUCCESS); - } -} - -/** Local 'connect' function. -*/ - -static valerie_response miracle_local_connect( miracle_local local ) -{ - valerie_response response = valerie_response_init( ); - - self = pthread_self( ); - - valerie_response_set_error( response, 100, "VTR Ready" ); - - signal( SIGHUP, signal_handler ); - signal( SIGINT, signal_handler ); - signal( SIGTERM, SIG_DFL ); - signal( SIGSTOP, signal_handler ); - signal( SIGPIPE, signal_handler ); - signal( SIGALRM, signal_handler ); - signal( SIGCHLD, SIG_IGN ); - - return response; -} - -/** Set the error and determine the message associated to this command. -*/ - -void miracle_command_set_error( command_argument cmd, response_codes code ) -{ - valerie_response_set_error( cmd->response, code, get_response_msg( code ) ); -} - -/** Parse the unit argument. -*/ - -int miracle_command_parse_unit( command_argument cmd, int argument ) -{ - int unit = -1; - char *string = valerie_tokeniser_get_string( cmd->tokeniser, argument ); - if ( string != NULL && ( string[ 0 ] == 'U' || string[ 0 ] == 'u' ) && strlen( string ) > 1 ) - unit = atoi( string + 1 ); - return unit; -} - -/** Parse a normal argument. -*/ - -void *miracle_command_parse_argument( command_argument cmd, int argument, arguments_types type ) -{ - void *ret = NULL; - char *value = valerie_tokeniser_get_string( cmd->tokeniser, argument ); - - if ( value != NULL ) - { - switch( type ) - { - case ATYPE_NONE: - break; - - case ATYPE_FLOAT: - ret = malloc( sizeof( float ) ); - if ( ret != NULL ) - *( float * )ret = atof( value ); - break; - - case ATYPE_STRING: - ret = strdup( value ); - break; - - case ATYPE_INT: - ret = malloc( sizeof( int ) ); - if ( ret != NULL ) - *( int * )ret = atoi( value ); - break; - } - } - - return ret; -} - -/** Get the error code - note that we simply the success return. -*/ - -response_codes miracle_command_get_error( command_argument cmd ) -{ - response_codes ret = valerie_response_get_error_code( cmd->response ); - if ( ret == RESPONSE_SUCCESS_N || ret == RESPONSE_SUCCESS_1 ) - ret = RESPONSE_SUCCESS; - return ret; -} - -/** Execute the command. -*/ - -static valerie_response miracle_local_execute( miracle_local local, char *command ) -{ - command_argument_t cmd; - cmd.parser = local->parser; - cmd.response = valerie_response_init( ); - cmd.tokeniser = valerie_tokeniser_init( ); - cmd.command = command; - cmd.unit = -1; - cmd.argument = NULL; - cmd.root_dir = local->root_dir; - - /* Set the default error */ - miracle_command_set_error( &cmd, RESPONSE_UNKNOWN_COMMAND ); - - /* Parse the command */ - if ( valerie_tokeniser_parse_new( cmd.tokeniser, command, " " ) > 0 ) - { - int index = 0; - char *value = valerie_tokeniser_get_string( cmd.tokeniser, 0 ); - int found = 0; - - /* Strip quotes from all tokens */ - for ( index = 0; index < valerie_tokeniser_count( cmd.tokeniser ); index ++ ) - valerie_util_strip( valerie_tokeniser_get_string( cmd.tokeniser, index ), '\"' ); - - /* Search the vocabulary array for value */ - for ( index = 1; !found && vocabulary[ index ].command != NULL; index ++ ) - if ( ( found = !strcasecmp( vocabulary[ index ].command, value ) ) ) - break; - - /* If we found something, the handle the args and call the handler. */ - if ( found ) - { - int position = 1; - - miracle_command_set_error( &cmd, RESPONSE_SUCCESS ); - - if ( vocabulary[ index ].is_unit ) - { - cmd.unit = miracle_command_parse_unit( &cmd, position ); - if ( cmd.unit == -1 ) - miracle_command_set_error( &cmd, RESPONSE_MISSING_ARG ); - position ++; - } - - if ( miracle_command_get_error( &cmd ) == RESPONSE_SUCCESS ) - { - cmd.argument = miracle_command_parse_argument( &cmd, position, vocabulary[ index ].type ); - if ( cmd.argument == NULL && vocabulary[ index ].type != ATYPE_NONE ) - miracle_command_set_error( &cmd, RESPONSE_MISSING_ARG ); - position ++; - } - - if ( miracle_command_get_error( &cmd ) == RESPONSE_SUCCESS ) - { - response_codes error = vocabulary[ index ].operation( &cmd ); - miracle_command_set_error( &cmd, error ); - } - - free( cmd.argument ); - } - } - - valerie_tokeniser_close( cmd.tokeniser ); - - return cmd.response; -} - -/** Close the parser. -*/ - -static void miracle_local_close( miracle_local local ) -{ - miracle_delete_all_units(); - pthread_kill_other_threads_np(); - miracle_log( LOG_DEBUG, "Clean shutdown." ); - free( local ); - //mlt_factory_close( ); -} diff --git a/mlt/src/miracle/miracle_local.h b/mlt/src/miracle/miracle_local.h deleted file mode 100644 index 6baf035..0000000 --- a/mlt/src/miracle/miracle_local.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * miracle_local.h -- Local dv1394d Parser - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -#ifndef _MIRACLE_LOCAL_H_ -#define _MIRACLE_LOCAL_H_ - -/* Application header files */ -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Local parser API. -*/ - -extern valerie_parser miracle_parser_init_local( ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/miracle/miracle_log.c b/mlt/src/miracle/miracle_log.c deleted file mode 100644 index f5f7e1a..0000000 --- a/mlt/src/miracle/miracle_log.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * miracle_log.c -- logging facility implementation - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#include -#include -#include - -#include "miracle_log.h" - -static int log_output = log_stderr; -static int threshold = LOG_DEBUG; - -void miracle_log_init( enum log_output method, int new_threshold ) -{ - log_output = method; - threshold = new_threshold; - if (method == log_syslog) - openlog( "miracle", LOG_CONS, LOG_DAEMON ); - -} - -void miracle_log( int priority, char *format, ... ) -{ - va_list list; - va_start( list, format ); - if ( LOG_PRI(priority) <= threshold ) - { - if ( log_output == log_syslog ) - { - vsyslog( priority, format, list ); - } - else - { - char line[1024]; - if ( snprintf( line, 1024, "(%d) %s\n", priority, format ) != 0 ) - vfprintf( stderr, line, list ); - } - } - va_end( list ); -} diff --git a/mlt/src/miracle/miracle_log.h b/mlt/src/miracle/miracle_log.h deleted file mode 100644 index 3788ee5..0000000 --- a/mlt/src/miracle/miracle_log.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * miracle_log.h -- logging facility header - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _LOG_H_ -#define _LOG_H_ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -enum log_output { - log_stderr, - log_syslog -}; - -void miracle_log_init( enum log_output method, int threshold ); -void miracle_log( int priority, char *format, ... ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/miracle/miracle_server.c b/mlt/src/miracle/miracle_server.c deleted file mode 100644 index 3c82c33..0000000 --- a/mlt/src/miracle/miracle_server.c +++ /dev/null @@ -1,272 +0,0 @@ -/* - * miracle_server.c -- DV Server - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -/* System header files */ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/* Application header files */ -#include "miracle_server.h" -#include "miracle_connection.h" -#include "miracle_local.h" -#include "miracle_log.h" -#include -#include - -#define VERSION "0.0.1" - -/** Initialise a server structure. -*/ - -miracle_server miracle_server_init( char *id ) -{ - miracle_server server = malloc( sizeof( miracle_server_t ) ); - if ( server != NULL ) - { - memset( server, 0, sizeof( miracle_server_t ) ); - server->id = id; - server->port = DEFAULT_TCP_PORT; - server->socket = -1; - } - return server; -} - -/** Set the port of the server. -*/ - -void miracle_server_set_port( miracle_server server, int port ) -{ - server->port = port; -} - -void miracle_server_set_proxy( miracle_server server, char *proxy ) -{ - valerie_tokeniser tokeniser = valerie_tokeniser_init( ); - server->proxy = 1; - server->remote_port = DEFAULT_TCP_PORT; - valerie_tokeniser_parse_new( tokeniser, proxy, ":" ); - strcpy( server->remote_server, valerie_tokeniser_get_string( tokeniser, 0 ) ); - if ( valerie_tokeniser_count( tokeniser ) == 2 ) - server->remote_port = atoi( valerie_tokeniser_get_string( tokeniser, 1 ) ); - valerie_tokeniser_close( tokeniser ); -} - -/** Wait for a connection. -*/ - -static int miracle_server_wait_for_connect( miracle_server server ) -{ - struct timeval tv; - fd_set rfds; - - /* Wait for a 1 second. */ - tv.tv_sec = 1; - tv.tv_usec = 0; - - FD_ZERO( &rfds ); - FD_SET( server->socket, &rfds ); - - return select( server->socket + 1, &rfds, NULL, NULL, &tv); -} - -/** Run the server thread. -*/ - -static void *miracle_server_run( void *arg ) -{ - miracle_server server = arg; - pthread_t cmd_parse_info; - connection_t *tmp = NULL; - pthread_attr_t thread_attributes; - int socksize; - - socksize = sizeof( struct sockaddr ); - - miracle_log( LOG_NOTICE, "%s version %s listening on port %i", server->id, VERSION, server->port ); - - /* Create the initial thread. We want all threads to be created detached so - their resources get freed automatically. (CY: ... hmmph...) */ - pthread_attr_init( &thread_attributes ); - pthread_attr_setdetachstate( &thread_attributes, PTHREAD_CREATE_DETACHED ); - pthread_attr_init( &thread_attributes ); - pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED ); - /* pthread_attr_setschedpolicy( &thread_attributes, SCHED_RR ); */ - - while ( !server->shutdown ) - { - /* Wait for a new connection. */ - if ( miracle_server_wait_for_connect( server ) ) - { - /* Create a new block of data to hold a copy of the incoming connection for - our server thread. The thread should free this when it terminates. */ - - tmp = (connection_t*) malloc( sizeof(connection_t) ); - tmp->parser = server->parser; - tmp->fd = accept( server->socket, (struct sockaddr*) &(tmp->sin), &socksize ); - - /* Pass the connection to a parser thread :-/ */ - if ( tmp->fd != -1 ) - pthread_create( &cmd_parse_info, &thread_attributes, parser_thread, tmp ); - } - } - - miracle_log( LOG_NOTICE, "%s version %s server terminated.", server->id, VERSION ); - - return NULL; -} - -/** Execute the server thread. -*/ - -int miracle_server_execute( miracle_server server ) -{ - int error = 0; - valerie_response response = NULL; - int index = 0; - struct sockaddr_in ServerAddr; - int flag = 1; - - ServerAddr.sin_family = AF_INET; - ServerAddr.sin_port = htons( server->port ); - ServerAddr.sin_addr.s_addr = INADDR_ANY; - - /* Create socket, and bind to port. Listen there. Backlog = 5 - should be sufficient for listen (). */ - server->socket = socket( AF_INET, SOCK_STREAM, 0 ); - - if ( server->socket == -1 ) - { - server->shutdown = 1; - perror( "socket" ); - miracle_log( LOG_ERR, "%s unable to create socket.", server->id ); - return -1; - } - - setsockopt( server->socket, SOL_SOCKET, SO_REUSEADDR, (char *)&flag, sizeof( int ) ); - - if ( bind( server->socket, (struct sockaddr *) &ServerAddr, sizeof (ServerAddr) ) != 0 ) - { - server->shutdown = 1; - perror( "bind" ); - miracle_log( LOG_ERR, "%s unable to bind to port %d.", server->id, server->port ); - return -1; - } - - if ( listen( server->socket, 5 ) != 0 ) - { - server->shutdown = 1; - perror( "listen" ); - miracle_log( LOG_ERR, "%s unable to listen on port %d.", server->id, server->port ); - return -1; - } - - fcntl( server->socket, F_SETFL, O_NONBLOCK ); - - if ( !server->proxy ) - { - miracle_log( LOG_NOTICE, "Starting server on %d.", server->port ); - server->parser = miracle_parser_init_local( ); - } - else - { - miracle_log( LOG_NOTICE, "Starting proxy for %s:%d on %d.", server->remote_server, server->remote_port, server->port ); - server->parser = valerie_parser_init_remote( server->remote_server, server->remote_port ); - } - - response = valerie_parser_connect( server->parser ); - - if ( response != NULL && valerie_response_get_error_code( response ) == 100 ) - { - /* read configuration file */ - if ( response != NULL && !server->proxy ) - { - valerie_response_close( response ); - response = valerie_parser_run( server->parser, "/etc/miracle.conf" ); - - if ( valerie_response_count( response ) > 1 ) - { - if ( valerie_response_get_error_code( response ) > 299 ) - miracle_log( LOG_ERR, "Error evaluating server configuration. Processing stopped." ); - for ( index = 0; index < valerie_response_count( response ); index ++ ) - miracle_log( LOG_DEBUG, "%4d: %s", index, valerie_response_get_line( response, index ) ); - } - } - - if ( response != NULL ) - { - pthread_attr_t attr; - int result; - pthread_attr_init( &attr ); - pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_JOINABLE ); - pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); - pthread_attr_setschedpolicy( &attr, SCHED_FIFO ); - pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ); - valerie_response_close( response ); - result = pthread_create( &server->thread, &attr, miracle_server_run, server ); - if ( result ) - { - miracle_log( LOG_WARNING, "Failed to schedule realtime (%s)", strerror(errno) ); - pthread_attr_setschedpolicy( &attr, SCHED_OTHER ); - result = pthread_create( &server->thread, &attr, miracle_server_run, server ); - if ( result ) - { - miracle_log( LOG_CRIT, "Failed to launch TCP listener thread" ); - error = -1; - } - } - } - } - else - { - miracle_log( LOG_ERR, "Error connecting to parser. Processing stopped." ); - server->shutdown = 1; - error = -1; - } - - return error; -} - -/** Shutdown the server. -*/ - -void miracle_server_shutdown( miracle_server server ) -{ - if ( server != NULL && !server->shutdown ) - { - server->shutdown = 1; - pthread_join( server->thread, NULL ); - valerie_parser_close( server->parser ); - close( server->socket ); - } -} diff --git a/mlt/src/miracle/miracle_server.h b/mlt/src/miracle/miracle_server.h deleted file mode 100644 index 95dfb52..0000000 --- a/mlt/src/miracle/miracle_server.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * miracle_server.h -- DV Server - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -#ifndef _MIRACLE_SERVER_H_ -#define _MIRACLE_SERVER_H_ - -/* System header files */ -#include - -/* Application header files */ -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Servers default port -*/ - -#define DEFAULT_TCP_PORT 5250 - -/** Structure for the server -*/ - -typedef struct -{ - char *id; - int port; - int socket; - valerie_parser parser; - pthread_t thread; - int shutdown; - int proxy; - char remote_server[ 50 ]; - int remote_port; -} -*miracle_server, miracle_server_t; - -/** API for the server -*/ - -extern miracle_server miracle_server_init( char * ); -extern void miracle_server_set_port( miracle_server, int ); -extern void miracle_server_set_proxy( miracle_server, char * ); -extern int miracle_server_execute( miracle_server ); -extern void miracle_server_shutdown( miracle_server ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/miracle/miracle_unit.c b/mlt/src/miracle/miracle_unit.c deleted file mode 100644 index f7023d0..0000000 --- a/mlt/src/miracle/miracle_unit.c +++ /dev/null @@ -1,645 +0,0 @@ -/* - * miracle_unit.c -- DV Transmission Unit Implementation - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "miracle_unit.h" -#include "miracle_log.h" -#include "miracle_local.h" - -#include - -/* Forward references */ -static void miracle_unit_status_communicate( miracle_unit ); - -/** Allocate a new DV transmission unit. - - \return A new miracle_unit handle. -*/ - -miracle_unit miracle_unit_init( int index, char *constructor ) -{ - miracle_unit this = NULL; - mlt_consumer consumer = NULL; - - char *id = strdup( constructor ); - char *arg = strchr( id, ':' ); - - if ( arg != NULL ) - *arg ++ = '\0'; - - consumer = mlt_factory_consumer( id, arg ); - - if ( consumer != NULL ) - { - mlt_playlist playlist = mlt_playlist_init( ); - this = calloc( sizeof( miracle_unit_t ), 1 ); - this->properties = mlt_properties_new( ); - this->producers = mlt_properties_new( ); - mlt_properties_init( this->properties, this ); - mlt_properties_set_int( this->properties, "unit", index ); - mlt_properties_set_int( this->properties, "generation", 0 ); - mlt_properties_set( this->properties, "constructor", constructor ); - mlt_properties_set( this->properties, "id", id ); - mlt_properties_set( this->properties, "arg", arg ); - mlt_properties_set_data( this->properties, "consumer", consumer, 0, ( mlt_destructor )mlt_consumer_close, NULL ); - mlt_properties_set_data( this->properties, "playlist", playlist, 0, ( mlt_destructor )mlt_playlist_close, NULL ); - mlt_consumer_connect( consumer, mlt_playlist_service( playlist ) ); - } - - return this; -} - -/** Communicate the current status to all threads waiting on the notifier. -*/ - -static void miracle_unit_status_communicate( miracle_unit unit ) -{ - if ( unit != NULL ) - { - mlt_properties properties = unit->properties; - char *root_dir = mlt_properties_get( properties, "root" ); - valerie_notifier notifier = mlt_properties_get_data( properties, "notifier", NULL ); - valerie_status_t status; - - if ( root_dir != NULL && notifier != NULL ) - { - if ( miracle_unit_get_status( unit, &status ) == 0 ) - /* if ( !( ( status.status == unit_playing || status.status == unit_paused ) && - strcmp( status.clip, "" ) && - !strcmp( status.tail_clip, "" ) && - status.position == 0 && - status.in == 0 && - status.out == 0 ) ) */ - valerie_notifier_put( notifier, &status ); - } - } -} - -/** Set the notifier info -*/ - -void miracle_unit_set_notifier( miracle_unit this, valerie_notifier notifier, char *root_dir ) -{ - mlt_properties properties = this->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_properties playlist_properties = mlt_playlist_properties( playlist ); - - mlt_properties_set( properties, "root", root_dir ); - mlt_properties_set_data( properties, "notifier", notifier, 0, NULL, NULL ); - mlt_properties_set_data( playlist_properties, "notifier_arg", this, 0, NULL, NULL ); - mlt_properties_set_data( playlist_properties, "notifier", miracle_unit_status_communicate, 0, NULL, NULL ); - - miracle_unit_status_communicate( this ); -} - -/** Create or locate a producer for the file specified. -*/ - -static mlt_producer create_producer( miracle_unit unit, char *file ) -{ - // Get the unit properties - mlt_properties properties = unit->producers; - - // Check if we already have loaded this file - mlt_producer result = mlt_properties_get_data( properties, file, NULL ); - - if ( result == NULL ) - { - // 1st Line preferences - if ( strstr( file, ".inigo" ) ) - { - char *args[ 2 ] = { file, NULL }; - result = mlt_factory_producer( "inigo", args ); - } - else if ( strstr( file, ".mpg" ) ) - result = mlt_factory_producer( "mcmpeg", file ); - else if ( strstr( file, ".mpeg" ) ) - result = mlt_factory_producer( "mcmpeg", file ); - else if ( strstr( file, ".dv" ) ) - result = mlt_factory_producer( "mcdv", file ); - else if ( strstr( file, ".dif" ) ) - result = mlt_factory_producer( "mcdv", file ); - else if ( strstr( file, ".jpg" ) ) - result = mlt_factory_producer( "pixbuf", file ); - else if ( strstr( file, ".JPG" ) ) - result = mlt_factory_producer( "pixbuf", file ); - else if ( strstr( file, ".jpeg" ) ) - result = mlt_factory_producer( "pixbuf", file ); - else if ( strstr( file, ".png" ) ) - result = mlt_factory_producer( "pixbuf", file ); - else if ( strstr( file, ".tga" ) ) - result = mlt_factory_producer( "pixbuf", file ); - else if ( strstr( file, ".txt" ) ) - result = mlt_factory_producer( "pango", file ); - - // 2nd Line fallbacks - if ( result == NULL && strstr( file, ".dv" ) ) - result = mlt_factory_producer( "libdv", file ); - else if ( result == NULL && strstr( file, ".dif" ) ) - result = mlt_factory_producer( "libdv", file ); - - // 3rd line fallbacks - if ( result == NULL ) - result = mlt_factory_producer( "ffmpeg", file ); - - // Now store the result - mlt_properties_set_data( properties, file, result, 0, ( mlt_destructor )mlt_producer_close, NULL ); - } - - return result; -} - -/** Update the generation count. -*/ - -static void update_generation( miracle_unit unit ) -{ - mlt_properties properties = unit->properties; - int generation = mlt_properties_get_int( properties, "generation" ); - mlt_properties_set_int( properties, "generation", ++ generation ); -} - -/** Wipe all clips on the playlist for this unit. -*/ - -static void clear_unit( miracle_unit unit ) -{ - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_producer producer = mlt_playlist_producer( playlist ); - - mlt_playlist_clear( playlist ); - mlt_producer_seek( producer, 0 ); - - if ( unit->old_producers != NULL ) - mlt_properties_close( unit->old_producers ); - unit->old_producers = unit->producers; - unit->producers = mlt_properties_new( ); - - update_generation( unit ); -} - -/** Generate a report on all loaded clips. -*/ - -void miracle_unit_report_list( miracle_unit unit, valerie_response response ) -{ - int i; - mlt_properties properties = unit->properties; - int generation = mlt_properties_get_int( properties, "generation" ); - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - - valerie_response_printf( response, 1024, "%d\n", generation ); - - for ( i = 0; i < mlt_playlist_count( playlist ); i ++ ) - { - mlt_playlist_clip_info info; - mlt_playlist_get_clip_info( playlist , &info, i ); - valerie_response_printf( response, 10240, "%d \"%s\" %lld %lld %lld %lld %.2f\n", - i, info.resource, - info.frame_in, - info.frame_out, - info.frame_count, - info.length, - info.fps ); - } -} - -/** Load a clip into the unit clearing existing play list. - - \todo error handling - \param unit A miracle_unit handle. - \param clip The absolute file name of the clip to load. - \param in The starting frame (-1 for 0) - \param out The ending frame (-1 for maximum) -*/ - -valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, int64_t in, int64_t out, int flush ) -{ - // Have to clear the unit first - clear_unit( unit ); - - // Now try to create an producer - mlt_producer instance = create_producer( unit, clip ); - - if ( instance != NULL ) - { - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_playlist_append_io( playlist, instance, in, out ); - miracle_log( LOG_DEBUG, "loaded clip %s", clip ); - miracle_unit_status_communicate( unit ); - return valerie_ok; - } - - return valerie_invalid_file; -} - -valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, int64_t in, int64_t out ) -{ - mlt_producer instance = create_producer( unit, clip ); - - if ( instance != NULL ) - { - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_playlist_insert( playlist, instance, index, in, out ); - miracle_log( LOG_DEBUG, "inserted clip %s at %d", clip, index ); - update_generation( unit ); - miracle_unit_status_communicate( unit ); - return valerie_ok; - } - - return valerie_invalid_file; -} - -valerie_error_code miracle_unit_remove( miracle_unit unit, int index ) -{ - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_playlist_remove( playlist, index ); - miracle_log( LOG_DEBUG, "removed clip at %d", index ); - update_generation( unit ); - miracle_unit_status_communicate( unit ); - return valerie_ok; -} - -valerie_error_code miracle_unit_clean( miracle_unit unit ) -{ - clear_unit( unit ); - miracle_log( LOG_DEBUG, "Cleaned playlist" ); - miracle_unit_status_communicate( unit ); - return valerie_ok; -} - -valerie_error_code miracle_unit_move( miracle_unit unit, int src, int dest ) -{ - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_playlist_move( playlist, src, dest ); - miracle_log( LOG_DEBUG, "moved clip %d to %d", src, dest ); - update_generation( unit ); - miracle_unit_status_communicate( unit ); - return valerie_ok; -} - -/** Add a clip to the unit play list. - - \todo error handling - \param unit A miracle_unit handle. - \param clip The absolute file name of the clip to load. - \param in The starting frame (-1 for 0) - \param out The ending frame (-1 for maximum) -*/ - -valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, int64_t in, int64_t out ) -{ - mlt_producer instance = create_producer( unit, clip ); - - if ( instance != NULL ) - { - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_playlist_append_io( playlist, instance, in, out ); - miracle_log( LOG_DEBUG, "appended clip %s", clip ); - update_generation( unit ); - miracle_unit_status_communicate( unit ); - return valerie_ok; - } - - return valerie_invalid_file; -} - -/** Start playing the unit. - - \todo error handling - \param unit A miracle_unit handle. - \param speed An integer that specifies the playback rate as a - percentage multiplied by 100. -*/ - -void miracle_unit_play( miracle_unit_t *unit, int speed ) -{ - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_producer producer = mlt_playlist_producer( playlist ); - mlt_consumer consumer = mlt_properties_get_data( unit->properties, "consumer", NULL ); - mlt_producer_set_speed( producer, ( double )speed / 1000 ); - mlt_consumer_start( consumer ); - miracle_unit_status_communicate( unit ); -} - -/** Stop playback. - - Terminates the dv_pump and halts dv1394 transmission. - - \param unit A miracle_unit handle. -*/ - -void miracle_unit_terminate( miracle_unit unit ) -{ - mlt_consumer consumer = mlt_properties_get_data( unit->properties, "consumer", NULL ); - mlt_consumer_stop( consumer ); - miracle_unit_status_communicate( unit ); -} - -/** Query the status of unit playback. - - \param unit A miracle_unit handle. - \return 1 if the unit is not playing, 0 if playing. -*/ - -int miracle_unit_has_terminated( miracle_unit unit ) -{ - mlt_consumer consumer = mlt_properties_get_data( unit->properties, "consumer", NULL ); - return mlt_consumer_is_stopped( consumer ); -} - -/** Transfer the currently loaded clip to another unit -*/ - -int miracle_unit_transfer( miracle_unit dest_unit, miracle_unit src_unit ) -{ - return 0; -} - -/** Determine if unit is offline. -*/ - -int miracle_unit_is_offline( miracle_unit unit ) -{ - return 0; -} - -/** Obtain the status for a given unit -*/ - -int miracle_unit_get_status( miracle_unit unit, valerie_status status ) -{ - int error = unit == NULL; - - memset( status, 0, sizeof( valerie_status_t ) ); - - if ( !error ) - { - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_producer producer = mlt_playlist_producer( playlist ); - mlt_producer clip = mlt_playlist_current( playlist ); - - mlt_playlist_clip_info info; - int clip_index = mlt_playlist_current_clip( playlist ); - mlt_playlist_get_clip_info( playlist, &info, clip_index ); - - if ( info.resource != NULL && strcmp( info.resource, "" ) ) - { - strncpy( status->clip, info.resource, sizeof( status->clip ) ); - status->speed = (int)( mlt_producer_get_speed( producer ) * 1000.0 ); - status->fps = mlt_producer_get_fps( producer ); - status->in = info.frame_in; - status->out = info.frame_out; - status->position = mlt_producer_position( clip ); - status->length = mlt_producer_get_length( clip ); - strncpy( status->tail_clip, info.resource, sizeof( status->tail_clip ) ); - status->tail_in = info.frame_in; - status->tail_out = info.frame_out; - status->tail_position = mlt_producer_position( clip ); - status->tail_length = mlt_producer_get_length( clip ); - status->clip_index = mlt_playlist_current_clip( playlist ); - status->seek_flag = 1; - } - - status->generation = mlt_properties_get_int( properties, "generation" ); - - if ( miracle_unit_has_terminated( unit ) ) - status->status = unit_stopped; - else if ( !strcmp( status->clip, "" ) ) - status->status = unit_not_loaded; - else if ( status->speed == 0 ) - status->status = unit_paused; - else - status->status = unit_playing; - } - else - { - status->status = unit_undefined; - } - - status->unit = mlt_properties_get_int( unit->properties, "unit" ); - - return error; -} - -/** Change position in the playlist. -*/ - -void miracle_unit_change_position( miracle_unit unit, int clip, int64_t position ) -{ - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_producer producer = mlt_playlist_producer( playlist ); - mlt_playlist_clip_info info; - - if ( clip < 0 ) - { - clip = 0; - position = 0; - } - else if ( clip >= mlt_playlist_count( playlist ) ) - { - clip = mlt_playlist_count( playlist ) - 1; - position = LONG_MAX; - } - - if ( mlt_playlist_get_clip_info( playlist, &info, clip ) == 0 ) - { - int64_t frame_start = info.start; - int64_t frame_offset = position; - - if ( frame_offset < 0 ) - frame_offset = info.frame_out; - if ( frame_offset < info.frame_in ) - frame_offset = info.frame_in; - if ( frame_offset >= info.frame_out ) - frame_offset = info.frame_out; - - mlt_producer_seek( producer, frame_start + frame_offset - info.frame_in ); - } - - miracle_unit_status_communicate( unit ); -} - -/** Get the index of the current clip. -*/ - -int miracle_unit_get_current_clip( miracle_unit unit ) -{ - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - int clip_index = mlt_playlist_current_clip( playlist ); - return clip_index; -} - -/** Set a clip's in point -*/ - -int miracle_unit_set_clip_in( miracle_unit unit, int index, int64_t position ) -{ - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_playlist_clip_info info; - int error = mlt_playlist_get_clip_info( playlist, &info, index ); - - if ( error == 0 ) - { - miracle_unit_play( unit, 0 ); - error = mlt_playlist_resize_clip( playlist, index, position, info.frame_out ); - update_generation( unit ); - miracle_unit_change_position( unit, index, 0 ); - } - - return error; -} - -/** Set a clip's out point. -*/ - -int miracle_unit_set_clip_out( miracle_unit unit, int index, int64_t position ) -{ - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_playlist_clip_info info; - int error = mlt_playlist_get_clip_info( playlist, &info, index ); - - if ( error == 0 ) - { - miracle_unit_play( unit, 0 ); - error = mlt_playlist_resize_clip( playlist, index, info.frame_in, position ); - update_generation( unit ); - miracle_unit_status_communicate( unit ); - miracle_unit_change_position( unit, index, -1 ); - } - - return error; -} - -/** Step by specified position. -*/ - -void miracle_unit_step( miracle_unit unit, int64_t offset ) -{ - mlt_properties properties = unit->properties; - mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); - mlt_producer producer = mlt_playlist_producer( playlist ); - mlt_position position = mlt_producer_frame( producer ); - mlt_producer_seek( producer, position + offset ); -} - -/** Set the unit's clip mode regarding in and out points. -*/ - -//void miracle_unit_set_mode( miracle_unit unit, dv_player_clip_mode mode ) -//{ - //dv_player player = miracle_unit_get_dv_player( unit ); - //if ( player != NULL ) - //dv_player_set_clip_mode( player, mode ); - //miracle_unit_status_communicate( unit ); -//} - -/** Get the unit's clip mode regarding in and out points. -*/ - -//dv_player_clip_mode miracle_unit_get_mode( miracle_unit unit ) -//{ - //dv_player player = miracle_unit_get_dv_player( unit ); - //return dv_player_get_clip_mode( player ); -//} - -/** Set the unit's clip mode regarding eof handling. -*/ - -//void miracle_unit_set_eof_action( miracle_unit unit, dv_player_eof_action action ) -//{ - //dv_player player = miracle_unit_get_dv_player( unit ); - //dv_player_set_eof_action( player, action ); - //miracle_unit_status_communicate( unit ); -//} - -/** Get the unit's clip mode regarding eof handling. -*/ - -//dv_player_eof_action miracle_unit_get_eof_action( miracle_unit unit ) -//{ - //dv_player player = miracle_unit_get_dv_player( unit ); - //return dv_player_get_eof_action( player ); -//} - -int miracle_unit_set( miracle_unit unit, char *name_value ) -{ - mlt_playlist playlist = mlt_properties_get_data( unit->properties, "playlist", NULL ); - mlt_properties properties = mlt_playlist_properties( playlist ); - return mlt_properties_parse( properties, name_value ); -} - -char *miracle_unit_get( miracle_unit unit, char *name ) -{ - mlt_playlist playlist = mlt_properties_get_data( unit->properties, "playlist", NULL ); - mlt_properties properties = mlt_playlist_properties( playlist ); - return mlt_properties_get( properties, name ); -} - -/** Release the unit - - \todo error handling - \param unit A miracle_unit handle. -*/ - -void miracle_unit_close( miracle_unit unit ) -{ - if ( unit != NULL ) - { - miracle_log( LOG_DEBUG, "closing unit..." ); - if ( unit->old_producers != NULL ) - mlt_properties_close( unit->old_producers ); - mlt_properties_close( unit->properties ); - mlt_properties_close( unit->producers ); - free( unit ); - miracle_log( LOG_DEBUG, "... unit closed." ); - } -} - diff --git a/mlt/src/miracle/miracle_unit.h b/mlt/src/miracle/miracle_unit.h deleted file mode 100644 index 9cf2663..0000000 --- a/mlt/src/miracle/miracle_unit.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * dvunit.h -- DV Transmission Unit Header - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _DV_UNIT_H_ -#define _DV_UNIT_H_ - -#include - -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -typedef struct -{ - mlt_properties properties; - mlt_properties producers; - mlt_properties old_producers; -} -miracle_unit_t, *miracle_unit; - -extern miracle_unit miracle_unit_init( int index, char *arg ); -extern void miracle_unit_report_list( miracle_unit unit, valerie_response response ); -extern void miracle_unit_allow_stdin( miracle_unit unit, int flag ); -extern valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, int64_t in, int64_t out, int flush ); -extern valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, int64_t in, int64_t out ); -extern valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, int64_t in, int64_t out ); -extern valerie_error_code miracle_unit_remove( miracle_unit unit, int index ); -extern valerie_error_code miracle_unit_clean( miracle_unit unit ); -extern valerie_error_code miracle_unit_move( miracle_unit unit, int src, int dest ); -extern int miracle_unit_transfer( miracle_unit dest_unit, miracle_unit src_unit ); -extern void miracle_unit_play( miracle_unit_t *unit, int speed ); -extern void miracle_unit_terminate( miracle_unit ); -extern int miracle_unit_has_terminated( miracle_unit ); -extern int miracle_unit_get_nodeid( miracle_unit unit ); -extern int miracle_unit_get_channel( miracle_unit unit ); -extern int miracle_unit_is_offline( miracle_unit unit ); -extern void miracle_unit_set_notifier( miracle_unit, valerie_notifier, char * ); -extern int miracle_unit_get_status( miracle_unit, valerie_status ); -extern void miracle_unit_change_position( miracle_unit, int, int64_t position ); -extern void miracle_unit_change_speed( miracle_unit unit, int speed ); -extern int miracle_unit_set_clip_in( miracle_unit unit, int index, int64_t position ); -extern int miracle_unit_set_clip_out( miracle_unit unit, int index, int64_t position ); -//extern void miracle_unit_set_mode( miracle_unit unit, dv_player_clip_mode mode ); -//extern dv_player_clip_mode miracle_unit_get_mode( miracle_unit unit ); -//extern void miracle_unit_set_eof_action( miracle_unit unit, dv_player_eof_action mode ); -//extern dv_player_eof_action miracle_unit_get_eof_action( miracle_unit unit ); -extern void miracle_unit_step( miracle_unit unit, int64_t offset ); -extern void miracle_unit_close( miracle_unit unit ); -extern void miracle_unit_suspend( miracle_unit ); -extern void miracle_unit_restore( miracle_unit ); -extern int miracle_unit_set( miracle_unit, char *name_value ); -extern char * miracle_unit_get( miracle_unit, char *name ); -extern int miracle_unit_get_current_clip( miracle_unit ); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/miracle/miracle_unit_commands.c b/mlt/src/miracle/miracle_unit_commands.c deleted file mode 100644 index f38ff3a..0000000 --- a/mlt/src/miracle/miracle_unit_commands.c +++ /dev/null @@ -1,421 +0,0 @@ -/* - * unit_commands.c - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include "miracle_unit.h" -#include "miracle_commands.h" -#include "miracle_log.h" - -int miracle_load( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - char *filename = (char*) cmd_arg->argument; - char fullname[1024]; - int flush = 1; - - if ( filename[0] == '!' ) - { - flush = 0; - filename ++; - } - - if ( filename[0] == '/' ) - filename++; - - snprintf( fullname, 1023, "%s%s", cmd_arg->root_dir, filename ); - - if (unit == NULL) - return RESPONSE_INVALID_UNIT; - else - { - int64_t in = -1, out = -1; - if ( valerie_tokeniser_count( cmd_arg->tokeniser ) == 5 ) - { - in = atol( valerie_tokeniser_get_string( cmd_arg->tokeniser, 3 ) ); - out = atol( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) ); - } - if ( miracle_unit_load( unit, fullname, in, out, flush ) != valerie_ok ) - return RESPONSE_BAD_FILE; - } - return RESPONSE_SUCCESS; -} - -int miracle_list( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit( cmd_arg->unit ); - - if ( unit != NULL ) - { - miracle_unit_report_list( unit, cmd_arg->response ); - return RESPONSE_SUCCESS; - } - - return RESPONSE_INVALID_UNIT; -} - -static int parse_clip( command_argument cmd_arg, int arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - int clip = miracle_unit_get_current_clip( unit ); - - if ( valerie_tokeniser_count( cmd_arg->tokeniser ) > arg ) - { - char *token = valerie_tokeniser_get_string( cmd_arg->tokeniser, arg ); - if ( token[ 0 ] == '+' ) - clip += atoi( token + 1 ); - else if ( token[ 0 ] == '-' ) - clip -= atoi( token + 1 ); - else - clip = atoi( token ); - } - - return clip; -} - -int miracle_insert( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - char *filename = (char*) cmd_arg->argument; - char fullname[1024]; - - if ( filename[0] == '/' ) - filename++; - - snprintf( fullname, 1023, "%s%s", cmd_arg->root_dir, filename ); - - if (unit == NULL) - return RESPONSE_INVALID_UNIT; - else - { - long in = -1, out = -1; - int index = parse_clip( cmd_arg, 3 ); - - if ( valerie_tokeniser_count( cmd_arg->tokeniser ) == 6 ) - { - in = atoi( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) ); - out = atoi( valerie_tokeniser_get_string( cmd_arg->tokeniser, 5 ) ); - } - - switch( miracle_unit_insert( unit, fullname, index, in, out ) ) - { - case valerie_ok: - return RESPONSE_SUCCESS; - default: - return RESPONSE_BAD_FILE; - } - } - return RESPONSE_SUCCESS; -} - -int miracle_remove( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - - if (unit == NULL) - return RESPONSE_INVALID_UNIT; - else - { - int index = parse_clip( cmd_arg, 2 ); - - if ( miracle_unit_remove( unit, index ) != valerie_ok ) - return RESPONSE_BAD_FILE; - } - return RESPONSE_SUCCESS; -} - -int miracle_clean( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - - if (unit == NULL) - return RESPONSE_INVALID_UNIT; - else - { - if ( miracle_unit_clean( unit ) != valerie_ok ) - return RESPONSE_BAD_FILE; - } - return RESPONSE_SUCCESS; -} - -int miracle_move( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - - if ( unit != NULL ) - { - if ( valerie_tokeniser_count( cmd_arg->tokeniser ) > 2 ) - { - int src = parse_clip( cmd_arg, 2 ); - int dest = parse_clip( cmd_arg, 3 ); - - if ( miracle_unit_move( unit, src, dest ) != valerie_ok ) - return RESPONSE_BAD_FILE; - } - else - { - return RESPONSE_MISSING_ARG; - } - } - else - { - return RESPONSE_INVALID_UNIT; - } - - return RESPONSE_SUCCESS; -} - -int miracle_append( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - char *filename = (char*) cmd_arg->argument; - char fullname[1024]; - - if ( filename[0] == '/' ) - filename++; - - snprintf( fullname, 1023, "%s%s", cmd_arg->root_dir, filename ); - - if (unit == NULL) - return RESPONSE_INVALID_UNIT; - else - { - int64_t in = -1, out = -1; - if ( valerie_tokeniser_count( cmd_arg->tokeniser ) == 5 ) - { - in = atol( valerie_tokeniser_get_string( cmd_arg->tokeniser, 3 ) ); - out = atol( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) ); - } - switch ( miracle_unit_append( unit, fullname, in, out ) ) - { - case valerie_ok: - return RESPONSE_SUCCESS; - default: - return RESPONSE_BAD_FILE; - } - } - return RESPONSE_SUCCESS; -} - -int miracle_play( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - - if ( unit == NULL ) - { - return RESPONSE_INVALID_UNIT; - } - else - { - int speed = 1000; - if ( valerie_tokeniser_count( cmd_arg->tokeniser ) == 3 ) - speed = atoi( valerie_tokeniser_get_string( cmd_arg->tokeniser, 2 ) ); - miracle_unit_play( unit, speed ); - } - - return RESPONSE_SUCCESS; -} - -int miracle_stop( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - if ( unit == NULL ) - return RESPONSE_INVALID_UNIT; - else - { - miracle_unit_play( unit, 0 ); - miracle_unit_terminate( unit ); - } - return RESPONSE_SUCCESS; -} - -int miracle_pause( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - if ( unit == NULL ) - return RESPONSE_INVALID_UNIT; - else - miracle_unit_play( unit, 0 ); - return RESPONSE_SUCCESS; -} - -int miracle_rewind( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - if ( unit == NULL ) - return RESPONSE_INVALID_UNIT; - else - miracle_unit_play( unit, -2000 ); - return RESPONSE_SUCCESS; -} - -int miracle_step( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - - if (unit == NULL) - return RESPONSE_INVALID_UNIT; - else - { - miracle_unit_play( unit, 0 ); - miracle_unit_step( unit, *(int*) cmd_arg->argument ); - } - return RESPONSE_SUCCESS; -} - -int miracle_goto( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - int clip = parse_clip( cmd_arg, 3 ); - - if (unit == NULL || miracle_unit_is_offline(unit)) - return RESPONSE_INVALID_UNIT; - else - miracle_unit_change_position( unit, clip, *(int*) cmd_arg->argument ); - return RESPONSE_SUCCESS; -} - -int miracle_ff( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - if ( unit == NULL ) - return RESPONSE_INVALID_UNIT; - else - miracle_unit_play( unit, 2000 ); - return RESPONSE_SUCCESS; -} - -int miracle_set_in_point( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - int clip = parse_clip( cmd_arg, 3 ); - - if ( unit == NULL ) - return RESPONSE_INVALID_UNIT; - else - { - int position = *(int *) cmd_arg->argument; - - switch( miracle_unit_set_clip_in( unit, clip, position ) ) - { - case -1: - return RESPONSE_BAD_FILE; - case -2: - return RESPONSE_OUT_OF_RANGE; - } - } - return RESPONSE_SUCCESS; -} - -int miracle_set_out_point( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - int clip = parse_clip( cmd_arg, 3 ); - - if ( unit == NULL ) - return RESPONSE_INVALID_UNIT; - else - { - int position = *(int *) cmd_arg->argument; - - switch( miracle_unit_set_clip_out( unit, clip, position ) ) - { - case -1: - return RESPONSE_BAD_FILE; - case -2: - return RESPONSE_OUT_OF_RANGE; - } - } - - return RESPONSE_SUCCESS; -} - -int miracle_get_unit_status( command_argument cmd_arg ) -{ - valerie_status_t status; - int error = miracle_unit_get_status( miracle_get_unit( cmd_arg->unit ), &status ); - - if ( error == -1 ) - return RESPONSE_INVALID_UNIT; - else - { - char text[ 10240 ]; - valerie_response_printf( cmd_arg->response, sizeof( text ), valerie_status_serialise( &status, text, sizeof( text ) ) ); - return RESPONSE_SUCCESS_1; - } - return 0; -} - - -int miracle_set_unit_property( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - char *name_value = (char*) cmd_arg->argument; - if (unit == NULL) - return RESPONSE_INVALID_UNIT; - else - miracle_unit_set( unit, name_value ); - return RESPONSE_SUCCESS; -} - -int miracle_get_unit_property( command_argument cmd_arg ) -{ - miracle_unit unit = miracle_get_unit(cmd_arg->unit); - char *name = (char*) cmd_arg->argument; - char *value = miracle_unit_get( unit, name ); - if (unit == NULL) - return RESPONSE_INVALID_UNIT; - else if ( value != NULL ) - valerie_response_printf( cmd_arg->response, 1024, "%s\n", value ); - return RESPONSE_SUCCESS; -} - - -int miracle_transfer( command_argument cmd_arg ) -{ - /* - dv_unit src_unit = miracle_get_unit(cmd_arg->unit); - int dest_unit_id = -1; - char *string = (char*) cmd_arg->argument; - if ( string != NULL && ( string[ 0 ] == 'U' || string[ 0 ] == 'u' ) && strlen( string ) > 1 ) - dest_unit_id = atoi( string + 1 ); - - if ( src_unit != NULL && dest_unit_id != -1 ) - { - dv_unit dest_unit = miracle_get_unit( dest_unit_id ); - if ( dest_unit != NULL && !dv_unit_is_offline(dest_unit) && dest_unit != src_unit ) - { - dv_unit_transfer( dest_unit, src_unit ); - return RESPONSE_SUCCESS; - } - } - */ - return RESPONSE_INVALID_UNIT; -} diff --git a/mlt/src/miracle/miracle_unit_commands.h b/mlt/src/miracle/miracle_unit_commands.h deleted file mode 100644 index 575ff1b..0000000 --- a/mlt/src/miracle/miracle_unit_commands.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * unit_commands.h - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - - -#ifndef _UNIT_COMMANDS_H_ -#define _UNIT_COMMANDS_H_ - -#include "miracle_connection.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern response_codes miracle_list( command_argument ); -extern response_codes miracle_load( command_argument ); -extern response_codes miracle_insert( command_argument ); -extern response_codes miracle_remove( command_argument ); -extern response_codes miracle_clean( command_argument ); -extern response_codes miracle_move( command_argument ); -extern response_codes miracle_append( command_argument ); -extern response_codes miracle_play( command_argument ); -extern response_codes miracle_stop( command_argument ); -extern response_codes miracle_pause( command_argument ); -extern response_codes miracle_rewind( command_argument ); -extern response_codes miracle_step( command_argument ); -extern response_codes miracle_goto( command_argument ); -extern response_codes miracle_ff( command_argument ); -extern response_codes miracle_set_in_point( command_argument ); -extern response_codes miracle_set_out_point( command_argument ); -extern response_codes miracle_get_unit_status( command_argument ); -extern response_codes miracle_set_unit_property( command_argument ); -extern response_codes miracle_get_unit_property( command_argument ); -extern response_codes miracle_transfer( command_argument ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/modules/Makefile b/mlt/src/modules/Makefile deleted file mode 100644 index 45f7a31..0000000 --- a/mlt/src/modules/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -SUBDIRS = core gtk2 dv sdl mainconcept bluefish ffmpeg resample inigo westley - -all clean depend install: - list='$(SUBDIRS)'; \ - for subdir in $$list; do \ - if [ -f $$subdir/Makefile ] ; \ - then [ ! -f disable-$$subdir ] && $(MAKE) -C $$subdir $@; \ - fi \ - done - -dist-clean: - rm -f consumers.dat filters.dat producers.dat transitions.dat; \ - list='$(SUBDIRS)'; \ - for subdir in $$list; do \ - if [ -f $$subdir/Makefile ] ; \ - then [ ! -f disable-$$subdir ] && $(MAKE) -C $$subdir $@; \ - fi \ - done - diff --git a/mlt/src/modules/configure b/mlt/src/modules/configure deleted file mode 100755 index b33bc37..0000000 --- a/mlt/src/modules/configure +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Clean up disables if not in help mode -[ "$help" != "1" ] && rm -f disable-* producers.dat filters.dat transitions.dat consumers.dat - -# Iterate through arguments -for i in $* -do - case $i in - --disable-* ) touch disable-${i#--disable-} ;; - esac -done - -# Iterate through each of the components -for i in * -do - if [ -x $i/configure -a \( "$help" = "1" -o ! -f disable-$i \) ] - then - echo "Configuring modules/$i:" - pushd $i > /dev/null - ./configure $@ - [ $? != 0 ] && exit 1 - popd > /dev/null - fi -done - diff --git a/mlt/src/modules/core/Makefile b/mlt/src/modules/core/Makefile deleted file mode 100644 index 4c458d1..0000000 --- a/mlt/src/modules/core/Makefile +++ /dev/null @@ -1,35 +0,0 @@ - -TARGET = ../libmltcore.so - -OBJS = factory.o \ - producer_ppm.o \ - filter_deinterlace.o \ - filter_greyscale.o \ - filter_gamma.o \ - filter_resize.o \ - transition_composite.o \ - transition_luma.o \ - transition_mix.o \ - filter_volume.o - -CFLAGS = -I../../ -Wall -g -D_FILE_OFFSET_BITS=64 -pthread - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) -shared -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/modules/core/configure b/mlt/src/modules/core/configure deleted file mode 100755 index baedbae..0000000 --- a/mlt/src/modules/core/configure +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -if [ "$help" != "1" ] -then - -cat << EOF >> ../producers.dat -ppm libmltcore.so -EOF - -cat << EOF >> ../filters.dat -deinterlace libmltcore.so -gamma libmltcore.so -greyscale libmltcore.so -resize libmltcore.so -volume libmltcore.so -EOF - -cat << EOF >> ../transitions.dat -composite libmltcore.so -luma libmltcore.so -mix libmltcore.so -EOF - -fi - diff --git a/mlt/src/modules/core/factory.c b/mlt/src/modules/core/factory.c deleted file mode 100644 index 5353ac2..0000000 --- a/mlt/src/modules/core/factory.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * factory.c -- the factory method interfaces - * 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 program 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. - * - * 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. - */ - -#include - -#include "producer_ppm.h" -#include "filter_deinterlace.h" -#include "filter_greyscale.h" -#include "filter_resize.h" -#include "filter_gamma.h" -#include "transition_composite.h" -#include "transition_luma.h" -#include "transition_mix.h" -#include "filter_volume.h" - -void *mlt_create_producer( char *id, void *arg ) -{ - if ( !strcmp( id, "ppm" ) ) - return producer_ppm_init( arg ); - return NULL; -} - -void *mlt_create_filter( char *id, void *arg ) -{ - if ( !strcmp( id, "deinterlace" ) ) - return filter_deinterlace_init( arg ); - if ( !strcmp( id, "gamma" ) ) - return filter_gamma_init( arg ); - if ( !strcmp( id, "greyscale" ) ) - return filter_greyscale_init( arg ); - if ( !strcmp( id, "resize" ) ) - return filter_resize_init( arg ); - if ( !strcmp( id, "volume" ) ) - return filter_volume_init( arg ); - return NULL; -} - -void *mlt_create_transition( char *id, void *arg ) -{ - if ( !strcmp( id, "composite" ) ) - return transition_composite_init( arg ); - if ( !strcmp( id, "luma" ) ) - return transition_luma_init( arg ); - if ( !strcmp( id, "mix" ) ) - return transition_mix_init( arg ); - return NULL; -} - -void *mlt_create_consumer( char *id, void *arg ) -{ - return NULL; -} - diff --git a/mlt/src/modules/core/filter_deinterlace.c b/mlt/src/modules/core/filter_deinterlace.c deleted file mode 100644 index 7fc04b6..0000000 --- a/mlt/src/modules/core/filter_deinterlace.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * filter_deinterlace.c -- deinterlace filter - * 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 program 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. - * - * 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. - */ - -#include "filter_deinterlace.h" - -#include - -#include -#include - -/** Deinterlace class. -*/ - -typedef struct -{ - struct mlt_filter_s parent; -} -filter_deinterlace; - -/* Linear Blend filter - C version contributed by Rogerio Brito. - This algorithm has the same interface as the other functions. - - The destination "screen" (pdst) is constructed from the source - screen (psrc[0]) line by line. - - The i-th line of the destination screen is the average of 3 lines - from the source screen: the (i-1)-th, i-th and (i+1)-th lines, with - the i-th line having weight 2 in the computation. - - Remarks: - * each line on pdst doesn't depend on previous lines; - * due to the way the algorithm is defined, the first & last lines of the - screen aren't deinterlaced. - -*/ -static void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc, int width, int height ) -{ - register int x, y; - register uint8_t *l0, *l1, *l2, *l3; - - l0 = pdst; /* target line */ - l1 = psrc; /* 1st source line */ - l2 = l1 + width; /* 2nd source line = line that follows l1 */ - l3 = l2 + width; /* 3rd source line = line that follows l2 */ - - /* Copy the first line */ - memcpy(l0, l1, width); - l0 += width; - - for (y = 1; y < height-1; ++y) - { - /* computes avg of: l1 + 2*l2 + l3 */ - for (x = 0; x < width; ++x) - l0[x] = (l1[x] + (l2[x]<<1) + l3[x]) >> 2; - - /* updates the line pointers */ - l1 = l2; l2 = l3; l3 += width; - l0 += width; - } - - /* Copy the last line */ - memcpy(l0, l1, width); -} - -/** Do it :-). -*/ - -static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable ) -{ - mlt_frame_get_image( this, image, format, width, height, 1 ); - deinterlace_yuv( *image, *image, *width * 2, *height ); - return 0; -} - -/** Deinterlace filter processing - this should be lazy evaluation here... -*/ - -static mlt_frame deinterlace_process( mlt_filter this, mlt_frame frame ) -{ - mlt_frame_push_get_image( frame, filter_get_image ); - return frame; -} - -/** Constructor for the filter. -*/ - -mlt_filter filter_deinterlace_init( void *arg ) -{ - filter_deinterlace *this = calloc( sizeof( filter_deinterlace ), 1 ); - if ( this != NULL ) - { - mlt_filter filter = &this->parent; - mlt_filter_init( filter, this ); - filter->process = deinterlace_process; - return &this->parent; - } - return NULL; -} - diff --git a/mlt/src/modules/core/filter_deinterlace.h b/mlt/src/modules/core/filter_deinterlace.h deleted file mode 100644 index cfcd2fc..0000000 --- a/mlt/src/modules/core/filter_deinterlace.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_deinterlace.h -- deinterlace filter - * 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 program 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. - * - * 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. - */ - -#ifndef _FILTER_DEINTERLACE_H_ -#define _FILTER_DEINTERLACE_H_ - -#include - -extern mlt_filter filter_deinterlace_init( void *arg ); - -#endif diff --git a/mlt/src/modules/core/filter_gamma.c b/mlt/src/modules/core/filter_gamma.c deleted file mode 100644 index 3387561..0000000 --- a/mlt/src/modules/core/filter_gamma.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * filter_gamma.c -- gamma filter - * 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 program 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. - * - * 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. - */ - -#include "filter_gamma.h" - -#include - -#include -#include -#include - -/** Do it :-). -*/ - -static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable ) -{ - mlt_frame_get_image( this, image, format, width, height, 1 ); - uint8_t *p = *image; - uint8_t *q = *image + *width * *height * 2; - - // Get the gamma value - double gamma = mlt_properties_get_double( mlt_frame_properties( this ), "gamma" ); - - // Calculate the look up table - double exp = 1 / gamma; - uint8_t lookup[ 256 ]; - int i; - - for( i = 0; i < 256; i ++ ) - lookup[ i ] = ( uint8_t )( pow( ( double )i / 255.0, exp ) * 255 ); - - while ( p != q ) - { - *p = lookup[ *p ]; - p += 2; - } - - return 0; -} - -/** Filter processing. -*/ - -static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) -{ - double gamma = mlt_properties_get_double( mlt_filter_properties( this ), "gamma" ); - gamma = gamma <= 0 ? 2 : gamma; - mlt_frame_push_get_image( frame, filter_get_image ); - mlt_properties_set_double( mlt_frame_properties( frame ), "gamma", gamma ); - return frame; -} - -/** Constructor for the filter. -*/ - -mlt_filter filter_gamma_init( char *arg ) -{ - mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 ); - if ( this != NULL ) - { - mlt_filter_init( this, NULL ); - this->process = filter_process; - if ( arg != NULL ) - mlt_properties_set_double( mlt_filter_properties( this ), "gamma", atof( arg ) ); - } - return this; -} - diff --git a/mlt/src/modules/core/filter_gamma.h b/mlt/src/modules/core/filter_gamma.h deleted file mode 100644 index a969b8a..0000000 --- a/mlt/src/modules/core/filter_gamma.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_gamma.h -- gamma filter - * 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 program 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. - * - * 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. - */ - -#ifndef _FILTER_GAMMA_H_ -#define _FILTER_GAMMA_H_ - -#include - -extern mlt_filter filter_gamma_init( char *arg ); - -#endif diff --git a/mlt/src/modules/core/filter_greyscale.c b/mlt/src/modules/core/filter_greyscale.c deleted file mode 100644 index 170ff4f..0000000 --- a/mlt/src/modules/core/filter_greyscale.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * filter_greyscale.c -- greyscale filter - * 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 program 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. - * - * 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. - */ - -#include "filter_greyscale.h" - -#include - -#include -#include - -/** Greyscale class. -*/ - -typedef struct -{ - struct mlt_filter_s parent; -} -filter_greyscale; - -/** Do it :-). -*/ - -static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable ) -{ - mlt_frame_get_image( this, image, format, width, height, 1 ); - uint8_t *p = *image; - uint8_t *q = *image + *width * *height * 2; - while ( p ++ != q ) - *p ++ = 128; - return 0; -} - -/** Filter processing. -*/ - -static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) -{ - mlt_frame_push_get_image( frame, filter_get_image ); - return frame; -} - -/** Constructor for the filter. -*/ - -mlt_filter filter_greyscale_init( void *arg ) -{ - filter_greyscale *this = calloc( sizeof( filter_greyscale ), 1 ); - if ( this != NULL ) - { - mlt_filter filter = &this->parent; - mlt_filter_init( filter, this ); - filter->process = filter_process; - } - return ( mlt_filter )this; -} - diff --git a/mlt/src/modules/core/filter_greyscale.h b/mlt/src/modules/core/filter_greyscale.h deleted file mode 100644 index 30515f5..0000000 --- a/mlt/src/modules/core/filter_greyscale.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_greyscale.h -- greyscale filter - * 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 program 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. - * - * 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. - */ - -#ifndef _FILTER_GREYSCALE_H_ -#define _FILTER_GREYSCALE_H_ - -#include - -extern mlt_filter filter_greyscale_init( void *arg ); - -#endif diff --git a/mlt/src/modules/core/filter_resize.c b/mlt/src/modules/core/filter_resize.c deleted file mode 100644 index 537ce50..0000000 --- a/mlt/src/modules/core/filter_resize.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * filter_resize.c -- resizing filter - * 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 program 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. - * - * 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. - */ - -#include "filter_resize.h" - -#include - -#include -#include -#include - -/** Do it :-). -*/ - -static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable ) -{ - int owidth = *width; - int oheight = *height; - mlt_frame_get_image( this, image, format, &owidth, &oheight, 0 ); - if ( *width == 0 ) - *width = 720; - if ( *height == 0 ) - *height = 576; - if ( !strcmp( mlt_properties_get( mlt_frame_properties( this ), "resize.scale" ), "affine" ) ) - *image = mlt_frame_rescale_yuv422( this, *width, *height ); - else - *image = mlt_frame_resize_yuv422( this, *width, *height ); - return 0; -} - -/** Filter processing. -*/ - -static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) -{ - mlt_frame_push_get_image( frame, filter_get_image ); - mlt_properties_set( mlt_frame_properties( frame ), "resize.scale", mlt_properties_get( mlt_filter_properties( this ), "scale" ) ); - return frame; -} - -/** Constructor for the filter. -*/ - -mlt_filter filter_resize_init( char *arg ) -{ - mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 ); - if ( mlt_filter_init( this, this ) == 0 ) - { - this->process = filter_process; - if ( arg != NULL ) - mlt_properties_set( mlt_filter_properties( this ), "scale", arg ); - else - mlt_properties_set( mlt_filter_properties( this ), "scale", "off" ); - } - return this; -} - diff --git a/mlt/src/modules/core/filter_resize.h b/mlt/src/modules/core/filter_resize.h deleted file mode 100644 index 17c9c19..0000000 --- a/mlt/src/modules/core/filter_resize.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_resize.h -- resizing filter - * 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 program 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. - * - * 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. - */ - -#ifndef _FILTER_RESIZE_H_ -#define _FILTER_RESIZE_H_ - -#include - -extern mlt_filter filter_resize_init( char *arg ); - -#endif diff --git a/mlt/src/modules/core/filter_volume.c b/mlt/src/modules/core/filter_volume.c deleted file mode 100644 index c0ad4dd..0000000 --- a/mlt/src/modules/core/filter_volume.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * filter_volume.c -- adjust audio volume - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#include "filter_volume.h" - -#include - -#include -#include - -/** Get the audio. -*/ - -static int filter_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples ) -{ - // Get the properties of the a frame - mlt_properties properties = mlt_frame_properties( frame ); - double volume = mlt_properties_get_double( properties, "volume" ); - - // Restore the original get_audio - frame->get_audio = mlt_properties_get_data( properties, "volume.get_audio", NULL ); - - // Get the producer's audio - mlt_frame_get_audio( frame, buffer, format, frequency, channels, samples ); - - // Apply the volume - int i; - for ( i = 0; i < ( *channels * *samples ); i++ ) - (*buffer)[i] *= volume; - - return 0; -} - -/** Filter processing. -*/ - -static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) -{ - mlt_properties properties = mlt_frame_properties( frame ); - - // Propogate the level property - if ( mlt_properties_get( mlt_filter_properties( this ), "volume" ) != NULL ) - mlt_properties_set_double( properties, "volume", - mlt_properties_get_double( mlt_filter_properties( this ), "volume" ) ); - - // Backup the original get_audio (it's still needed) - mlt_properties_set_data( properties, "volume.get_audio", frame->get_audio, 0, NULL, NULL ); - - // Override the get_audio method - frame->get_audio = filter_get_audio; - - return frame; -} - -/** Constructor for the filter. -*/ - -mlt_filter filter_volume_init( char *arg ) -{ - mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 ); - if ( this != NULL && mlt_filter_init( this, NULL ) == 0 ) - { - this->process = filter_process; - if ( arg != NULL ) - mlt_properties_set_double( mlt_filter_properties( this ), "volume", atof( arg ) ); - } - return this; -} - diff --git a/mlt/src/modules/core/filter_volume.h b/mlt/src/modules/core/filter_volume.h deleted file mode 100644 index d5fb569..0000000 --- a/mlt/src/modules/core/filter_volume.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_volume.h -- adjust audio volume - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _FILTER_VOLUME_H_ -#define _FILTER_VOLUME_H_ - -#include - -extern mlt_filter filter_volume_init( char *arg ); - -#endif diff --git a/mlt/src/modules/core/producer_ppm.c b/mlt/src/modules/core/producer_ppm.c deleted file mode 100644 index c929d25..0000000 --- a/mlt/src/modules/core/producer_ppm.c +++ /dev/null @@ -1,272 +0,0 @@ -/* - * producer_ppm.c -- simple ppm test case - * 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 program 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. - * - * 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. - */ - -#include "producer_ppm.h" -#include -#include -#include - -typedef struct producer_ppm_s *producer_ppm; - -struct producer_ppm_s -{ - struct mlt_producer_s parent; - char *command; - FILE *video; - FILE *audio; - uint64_t expected; -}; - -static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index ); -static void producer_close( mlt_producer parent ); - -mlt_producer producer_ppm_init( void *command ) -{ - producer_ppm this = calloc( sizeof( struct producer_ppm_s ), 1 ); - if ( this != NULL && mlt_producer_init( &this->parent, this ) == 0 ) - { - mlt_producer producer = &this->parent; - mlt_properties properties = mlt_producer_properties( producer ); - - producer->get_frame = producer_get_frame; - producer->close = producer_close; - - if ( command != NULL ) - { - mlt_properties_set( properties, "resource", command ); - this->command = strdup( command ); - } - else - { - mlt_properties_set( properties, "resource", "ppm test" ); - } - - return producer; - } - free( this ); - return NULL; -} - -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 ); - - if ( mlt_properties_get_int( properties, "has_image" ) ) - { - // Get the RGB image - uint8_t *rgb = mlt_properties_get_data( properties, "image", NULL ); - - // Get width and height - *width = mlt_properties_get_int( properties, "width" ); - *height = mlt_properties_get_int( properties, "height" ); - - // Convert to requested format - if ( *format == mlt_image_yuv422 ) - { - uint8_t *image = malloc( *width * *height * 2 ); - mlt_convert_rgb24_to_yuv422( rgb, *width, *height, *width * 3, image ); - mlt_properties_set_data( properties, "image", image, *width * *height * 2, free, NULL ); - *buffer = image; - } - else if ( *format == mlt_image_rgb24 ) - { - *buffer = rgb; - } - } - else - { - mlt_frame_get_image( this, buffer, format, width, height, writable ); - } - - return 0; -} - -FILE *producer_ppm_run_video( producer_ppm this ) -{ - if ( this->video == NULL ) - { - if ( this->command == NULL ) - { - this->video = popen( "image2raw -k -r 25 -ppm /usr/share/pixmaps/*.png", "r" ); - } - else - { - char command[ 1024 ]; - float fps = mlt_producer_get_fps( &this->parent ); - float position = mlt_producer_position( &this->parent ); - sprintf( command, "ffmpeg -i \"%s\" -ss %f -f imagepipe -r %f -img ppm - 2>/dev/null", this->command, position, fps ); - this->video = popen( command, "r" ); - } - } - return this->video; -} - -FILE *producer_ppm_run_audio( producer_ppm this ) -{ - if ( this->audio == NULL ) - { - if ( this->command != NULL ) - { - char command[ 1024 ]; - float position = mlt_producer_position( &this->parent ); - sprintf( command, "ffmpeg -i \"%s\" -ss %f -f s16le -ar 48000 -ac 2 - 2>/dev/null", this->command, position ); - this->audio = popen( command, "r" ); - } - } - return this->audio; -} - -static void producer_ppm_position( producer_ppm this, uint64_t requested ) -{ - if ( requested != this->expected ) - { - if ( this->video != NULL ) - pclose( this->video ); - this->video = NULL; - if ( this->audio != NULL ) - pclose( this->audio ); - this->audio = NULL; - } - - // This is the next frame we expect - this->expected = mlt_producer_frame( &this->parent ) + 1; - - // Open the pipe - this->video = producer_ppm_run_video( this ); - - // Open the audio pipe - this->audio = producer_ppm_run_audio( this ); - -} - -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 ); - - FILE *pipe = mlt_properties_get_data( properties, "audio.pipe", NULL ); - - *frequency = 48000; - *channels = 2; - *samples = 1920; - - // Size - int size = *samples * *channels * 2; - - // Allocate an image - *buffer = malloc( size ); - - // Read it - if ( pipe != NULL ) - fread( *buffer, size, 1, pipe ); - else - memset( *buffer, 0, size ); - - // Pass the data on the frame properties - mlt_properties_set_data( properties, "audio", *buffer, size, free, NULL ); - - return 0; -} - -static int read_ppm_header( FILE *video, int *width, int *height ) -{ - int count = 0; - { - char temp[ 132 ]; - fgets( temp, 132, video ); - fgets( temp, 132, video ); - count += sscanf( temp, "%d %d", width, height ); - fgets( temp, 132, video ); - } - return count; -} - -static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index ) -{ - producer_ppm this = producer->child; - int width; - int height; - - // Construct a test frame - *frame = mlt_frame_init( ); - - // Are we at the position expected? - producer_ppm_position( this, mlt_producer_frame( producer ) ); - - // Get the frames properties - mlt_properties properties = mlt_frame_properties( *frame ); - - FILE *video = this->video; - FILE *audio = this->audio; - - // Read the video - if ( video != NULL && read_ppm_header( video, &width, &height ) == 2 ) - { - - // Allocate an image - uint8_t *image = malloc( width * height * 3 ); - - // Read it - fread( image, width * height * 3, 1, video ); - - // Pass the data on the frame properties - mlt_properties_set_data( properties, "image", image, width * height * 3, free, NULL ); - mlt_properties_set_int( properties, "width", width ); - mlt_properties_set_int( properties, "height", height ); - mlt_properties_set_int( properties, "has_image", 1 ); - - // Push the image callback - mlt_frame_push_get_image( *frame, producer_get_image ); - } - else - { - // Push the image callback - mlt_frame_push_get_image( *frame, producer_get_image ); - } - - // Set the audio pipe - mlt_properties_set_data( properties, "audio.pipe", audio, 0, NULL, NULL ); - - // Hmm - register audio callback - ( *frame )->get_audio = producer_get_audio; - - // Update timecode on the frame we're creating - mlt_frame_set_position( *frame, mlt_producer_position( producer ) ); - - // Calculate the next timecode - mlt_producer_prepare_next( producer ); - - return 0; -} - -static void producer_close( mlt_producer parent ) -{ - producer_ppm this = parent->child; - if ( this->video ) - pclose( this->video ); - if ( this->audio ) - pclose( this->audio ); - free( this->command ); - parent->close = NULL; - mlt_producer_close( parent ); - free( this ); -} - diff --git a/mlt/src/modules/core/producer_ppm.h b/mlt/src/modules/core/producer_ppm.h deleted file mode 100644 index 205d546..0000000 --- a/mlt/src/modules/core/producer_ppm.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * producer_ppm.h -- simple ppm test case - * 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 program 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. - * - * 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. - */ - -#ifndef _PRODUCER_PPM_H_ -#define _PRODUCER_PPM_H_ - -#include -#include - -extern mlt_producer producer_ppm_init( void *command ); - -#endif diff --git a/mlt/src/modules/core/transition_composite.c b/mlt/src/modules/core/transition_composite.c deleted file mode 100644 index 7a32dd5..0000000 --- a/mlt/src/modules/core/transition_composite.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * transition_composite.c -- compose one image over another using alpha channel - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#include "transition_composite.h" -#include - -#include -#include - -/** Get the image. -*/ - -static int transition_get_image( mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable ) -{ - // Get the properties of the a frame - mlt_properties a_props = mlt_frame_properties( this ); - - // Get the b frame from the stack - mlt_frame b_frame = mlt_frame_pop_frame( this ); - - if ( b_frame != NULL ) - { - // Get the properties of the b frame - mlt_properties b_props = mlt_frame_properties( b_frame ); - - // Arbitrary composite defaults - int x = 0; - int y = 0; - double mix = 1.0; - - // Override from b frame properties if provided - if ( mlt_properties_get( b_props, "x" ) != NULL ) - x = mlt_properties_get_int( b_props, "x" ); - if ( mlt_properties_get( b_props, "y" ) != NULL ) - y = mlt_properties_get_int( b_props, "y" ); - if ( mlt_properties_get( b_props, "image.mix" ) != NULL ) - mix = mlt_properties_get_double( b_props, "image.mix" ); - - // Composite the b_frame on the a_frame - mlt_frame_composite_yuv( this, b_frame, x, y, mix ); - - // 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 ); - } - else if ( a_props != NULL ) - { - // 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 ); - } - - return 0; -} - -/** Composition transition processing. -*/ - -static mlt_frame composite_process( mlt_transition this, mlt_frame a_frame, mlt_frame b_frame ) -{ - // Propogate the transition properties to the b frame - mlt_properties properties = mlt_transition_properties( this ); - mlt_properties b_props = mlt_frame_properties( b_frame ); - - if ( mlt_properties_get( properties, "x" ) != NULL ) - mlt_properties_set_int( b_props, "x", mlt_properties_get_int( properties, "x" ) ); - if ( mlt_properties_get( properties, "y" ) != NULL ) - mlt_properties_set_int( b_props, "y", mlt_properties_get_int( properties, "y" ) ); - - // Only if mix is specified, otherwise a producer may set the mix - if ( mlt_properties_get( properties, "mix" ) != NULL ) - { - // A negative means dissolve - if ( mlt_properties_get_double( properties, "mix" ) < 0 ) - { - // Determine the time position of this frame in the transition duration - mlt_position in = mlt_transition_get_in( this ); - mlt_position out = mlt_transition_get_out( this ); - mlt_position time = mlt_frame_get_position( b_frame ); - double mix = ( double )( time - in ) / ( double )( out - in + 1 ); - mlt_properties_set_double( b_props, "image.mix", mix ); - } - else - mlt_properties_set_double( b_props, "image.mix", mlt_properties_get_double( properties, "mix" ) ); - } - - mlt_frame_push_get_image( a_frame, transition_get_image ); - mlt_frame_push_frame( a_frame, b_frame ); - - return a_frame; -} - -/** Constructor for the filter. -*/ - -mlt_transition transition_composite_init( char *arg ) -{ - mlt_transition this = calloc( sizeof( struct mlt_transition_s ), 1 ); - if ( this != NULL && mlt_transition_init( this, NULL ) == 0 ) - { - this->process = composite_process; - if ( arg != NULL ) - mlt_properties_set_double( mlt_transition_properties( this ), "mix", atof( arg ) ); - } - return this; -} - diff --git a/mlt/src/modules/core/transition_composite.h b/mlt/src/modules/core/transition_composite.h deleted file mode 100644 index 769ddfd..0000000 --- a/mlt/src/modules/core/transition_composite.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * transition_composite.h -- compose one image over another using alpha channel - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _TRANSITION_COMPOSITE_H_ -#define _TRANSITION_COMPOSITE_H_ - -#include - -extern mlt_transition transition_composite_init( char *arg ); - -#endif diff --git a/mlt/src/modules/core/transition_luma.c b/mlt/src/modules/core/transition_luma.c deleted file mode 100644 index 1aabc94..0000000 --- a/mlt/src/modules/core/transition_luma.c +++ /dev/null @@ -1,358 +0,0 @@ -/* - * transition_luma.c -- a generic dissolve/wipe processor - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#include "transition_luma.h" -#include - -#include -#include -#include -#include - -/** Luma class. -*/ - -typedef struct -{ - struct mlt_transition_s parent; - char *filename; - int width; - int height; - float *bitmap; -} -transition_luma; - - -// forward declarations -static void transition_close( mlt_transition parent ); - - -// image processing functions - -static inline float smoothstep( float edge1, float edge2, float a ) -{ - if ( a < edge1 ) - return 0.0; - - if ( a >= edge2 ) - return 1.0; - - a = ( a - edge1 ) / ( edge2 - edge1 ); - - return ( a * a * ( 3 - 2 * a ) ); -} - -/** powerful stuff - - \param field_order -1 = progressive, 0 = lower field first, 1 = top field first -*/ -static void luma_composite( mlt_frame this, mlt_frame b_frame, int luma_width, int luma_height, - float *luma_bitmap, float pos, float frame_delta, float softness, int field_order ) -{ - int width_src, height_src; - int width_dest, height_dest; - mlt_image_format format_src, format_dest; - uint8_t *p_src, *p_dest; - int i, j; - int stride_src; - int stride_dest; - float weight = 0; - int field; - - format_src = mlt_image_yuv422; - format_dest = mlt_image_yuv422; - - mlt_frame_get_image( this, &p_dest, &format_dest, &width_dest, &height_dest, 1 /* writable */ ); - mlt_frame_get_image( b_frame, &p_src, &format_src, &width_src, &height_src, 0 /* writable */ ); - - stride_src = width_src * 2; - stride_dest = width_dest * 2; - - // Offset the position based on which field we're looking at ... - float field_pos[ 2 ]; - field_pos[ 0 ] = pos + ( ( field_order == 0 ? 1 : 0 ) * frame_delta * 0.5 ); - field_pos[ 1 ] = pos + ( ( field_order == 0 ? 0 : 1 ) * frame_delta * 0.5 ); - - // adjust the position for the softness level - field_pos[ 0 ] *= ( 1.0 + softness ); - field_pos[ 1 ] *= ( 1.0 + softness ); - - uint8_t *p; - uint8_t *q; - uint8_t *o; - float *l; - - uint8_t y; - uint8_t uv; - float value; - - // composite using luma map - for ( field = 0; field < ( field_order < 0 ? 1 : 2 ); ++field ) - { - for ( i = field; i < height_src; i += ( field_order < 0 ? 1 : 2 ) ) - { - p = &p_src[ i * stride_src ]; - q = &p_dest[ i * stride_dest ]; - o = &p_dest[ i * stride_dest ]; - l = &luma_bitmap[ i * luma_width ]; - - for ( j = 0; j < width_src; j ++ ) - { - y = *p ++; - uv = *p ++; - weight = *l ++; - value = smoothstep( weight, weight + softness, field_pos[ field ] ); - - *o ++ = (uint8_t)( y * value + *q++ * ( 1 - value ) ); - *o ++ = (uint8_t)( uv * value + *q++ * ( 1 - value ) ); - } - } - } -} - -/** Get the image. -*/ - -static int transition_get_image( mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable ) -{ - // Get the properties of the a frame - mlt_properties a_props = mlt_frame_properties( this ); - - // Get the b frame from the stack - mlt_frame b_frame = mlt_frame_pop_frame( this ); - - // Get the properties of the b frame - mlt_properties b_props = mlt_frame_properties( b_frame ); - - // Arbitrary composite defaults - float frame_delta = 1 / mlt_properties_get_double( b_props, "fps" ); - float mix = mlt_properties_get_double( b_props, "image.mix" ); - int luma_width = mlt_properties_get_int( b_props, "luma.width" ); - int luma_height = mlt_properties_get_int( b_props, "luma.height" ); - float *luma_bitmap = mlt_properties_get_data( b_props, "luma.bitmap", NULL ); - float luma_softness = mlt_properties_get_double( b_props, "luma.softness" ); - int progressive = mlt_properties_get_int( b_props, "progressive" ); - int top_field_first = mlt_properties_get_int( b_props, "top_field_first" ); - int reverse = mlt_properties_get_int( b_props, "luma.reverse" ); - - // Honour the reverse here - mix = reverse ? 1 - mix : mix; - - if ( luma_width > 0 && luma_height > 0 && luma_bitmap != NULL ) - // Composite the frames using a luma map - luma_composite( this, b_frame, luma_width, luma_height, luma_bitmap, mix, frame_delta, - luma_softness, progressive > 0 ? -1 : top_field_first ); - else - // Dissolve the frames using the time offset for mix value - mlt_frame_composite_yuv( this, b_frame, 0, 0, mix ); - - // 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 ); - - return 0; -} - -/** Load the luma map from PGM stream. -*/ - -static void luma_read_pgm( FILE *f, float **map, int *width, int *height ) -{ - uint8_t *data = NULL; - while (1) - { - char line[128]; - int i = 2; - int maxval; - int bpp; - float *p; - - line[127] = '\0'; - - // get the magic code - if ( fgets( line, 127, f ) == NULL ) - break; - if ( line[0] != 'P' || line[1] != '5' ) - break; - - // skip white space and see if a new line must be fetched - for ( i = 2; i < 127 && line[i] != '\0' && isspace( line[i] ); i++ ); - if ( line[i] == '\0' && fgets( line, 127, f ) == NULL ) - break; - - // get the dimensions - if ( line[0] == 'P' ) - i = sscanf( line, "P5 %d %d %d", width, height, &maxval ); - else - i = sscanf( line, "%d %d %d", width, height, &maxval ); - - // get the height value, if not yet - if ( i < 2 ) - { - if ( fgets( line, 127, f ) == NULL ) - break; - i = sscanf( line, "%d", height ); - if ( i == 0 ) - break; - else - i = 2; - } - - // get the maximum gray value, if not yet - if ( i < 3 ) - { - if ( fgets( line, 127, f ) == NULL ) - break; - i = sscanf( line, "%d", &maxval ); - if ( i == 0 ) - break; - } - - // determine if this is one or two bytes per pixel - bpp = maxval > 255 ? 2 : 1; - // allocate temporary storage for the raw data - data = malloc( *width * *height * bpp ); - if ( data == NULL ) - break; - - // read the raw data - if ( fread( data, *width * *height * bpp, 1, f ) != 1 ) - break; - - // allocate the luma bitmap - *map = p = (float*) malloc( *width * *height * sizeof( float ) ); - if ( *map == NULL ) - break; - - // proces the raw data into the luma bitmap - for ( i = 0; i < *width * *height * bpp; i += bpp ) - { - if ( bpp == 1 ) - *p++ = (float) data[ i ] / (float) maxval; - else - *p++ = (float) ( ( data[ i ] << 8 ) + data[ i+1 ] ) / (float) maxval; - } - - break; - } - - if ( data != NULL ) - free( data ); -} - - -/** Luma transition processing. -*/ - -static mlt_frame transition_process( mlt_transition transition, mlt_frame a_frame, mlt_frame b_frame ) -{ - transition_luma *this = (transition_luma*) transition->child; - - // Get the properties of the transition - mlt_properties properties = mlt_transition_properties( transition ); - - // Get the properties of the b frame - mlt_properties b_props = mlt_frame_properties( b_frame ); - - // If the filename property changed, reload the map - char *luma_file = mlt_properties_get( properties, "filename" ); - if ( luma_file != NULL && ( this->filename == NULL || ( this->filename && strcmp( luma_file, this->filename ) ) ) ) - { - int width = mlt_properties_get_int( b_props, "width" ); - int height = mlt_properties_get_int( b_props, "height" ); - char command[ 512 ]; - FILE *pipe; - - command[ 511 ] = '\0'; - if ( this->filename ) - free( this->filename ); - this->filename = strdup( luma_file ); - snprintf( command, 511, "anytopnm %s | pnmscale -width %d -height %d", luma_file, width, height ); - //pipe = popen( command, "r" ); - pipe = fopen( luma_file, "r" ); - if ( pipe != NULL ) - { - if ( this->bitmap ) - free( this->bitmap ); - luma_read_pgm( pipe, &this->bitmap, &this->width, &this->height ); - //pclose( pipe ); - fclose( pipe ); - } - - } - - // Determine the time position of this frame in the transition duration - mlt_position in = mlt_transition_get_in( transition ); - mlt_position out = mlt_transition_get_out( transition ); - mlt_position time = mlt_frame_get_position( b_frame ); - float pos = ( float )( time - in ) / ( float )( out - in + 1 ); - - // Set the b frame properties - mlt_properties_set_double( b_props, "image.mix", pos ); - mlt_properties_set_int( b_props, "luma.width", this->width ); - mlt_properties_set_int( b_props, "luma.height", this->height ); - mlt_properties_set_data( b_props, "luma.bitmap", this->bitmap, 0, NULL, NULL ); - mlt_properties_set_int( b_props, "luma.reverse", mlt_properties_get_int( properties, "reverse" ) ); - mlt_properties_set_double( b_props, "luma.softness", mlt_properties_get_double( properties, "softness" ) ); - - mlt_frame_push_get_image( a_frame, transition_get_image ); - mlt_frame_push_frame( a_frame, b_frame ); - - return a_frame; -} - -/** Constructor for the filter. -*/ - -mlt_transition transition_luma_init( char *lumafile ) -{ - transition_luma *this = calloc( sizeof( transition_luma ), 1 ); - if ( this != NULL ) - { - mlt_transition transition = &this->parent; - mlt_transition_init( transition, this ); - transition->process = transition_process; - transition->close = transition_close; - - if ( lumafile != NULL ) - mlt_properties_set( mlt_transition_properties( transition ), "filename", lumafile ); - - return &this->parent; - } - return NULL; -} - -/** Close the transition. -*/ - -static void transition_close( mlt_transition parent ) -{ - transition_luma *this = (transition_luma*) parent->child; - - if ( this->bitmap ) - free( this->bitmap ); - - if ( this->filename ) - free( this->filename ); - - free( this ); -} - diff --git a/mlt/src/modules/core/transition_luma.h b/mlt/src/modules/core/transition_luma.h deleted file mode 100644 index 72f8283..0000000 --- a/mlt/src/modules/core/transition_luma.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * transition_luma.h -- a generic dissolve/wipe processor - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _TRANSITION_LUMA_H_ -#define _TRANSITION_LUMA_H_ - -#include - -extern mlt_transition transition_luma_init( char *lumafile ); - -#endif diff --git a/mlt/src/modules/core/transition_mix.c b/mlt/src/modules/core/transition_mix.c deleted file mode 100644 index 7b1521d..0000000 --- a/mlt/src/modules/core/transition_mix.c +++ /dev/null @@ -1,111 +0,0 @@ -/* - * transition_mix.c -- mix two audio streams - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#include "transition_mix.h" -#include - -#include -#include - - -/** Get the audio. -*/ - -static int transition_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples ) -{ - // Get the properties of the a frame - mlt_properties a_props = mlt_frame_properties( frame ); - - // Get the b frame from the stack - mlt_frame b_frame = mlt_frame_pop_frame( frame ); - - // Get the properties of the b frame - mlt_properties b_props = mlt_frame_properties( b_frame ); - - // Restore the original get_audio - frame->get_audio = mlt_properties_get_data( a_props, "mix.get_audio", NULL ); - - double mix = 0.5; - if ( mlt_properties_get( b_props, "audio.mix" ) != NULL ) - mix = mlt_properties_get_double( b_props, "audio.mix" ); - if ( mlt_properties_get_int( b_props, "audio.reverse" ) ) - mix = 1 - mix; - - mlt_frame_mix_audio( frame, b_frame, mix, buffer, format, frequency, channels, samples ); - - // Push the b_frame back on for get_image - mlt_frame_push_frame( frame, b_frame ); - - return 0; -} - - -/** Mix transition processing. -*/ - -static mlt_frame transition_process( mlt_transition this, mlt_frame a_frame, mlt_frame b_frame ) -{ - mlt_properties properties = mlt_transition_properties( this ); - mlt_properties b_props = mlt_frame_properties( b_frame ); - - // Only if mix is specified, otherwise a producer may set the mix - if ( mlt_properties_get( properties, "mix" ) != NULL ) - { - // A negative means crossfade - if ( mlt_properties_get_double( properties, "mix" ) < 0 ) - { - // Determine the time position of this frame in the transition duration - mlt_position in = mlt_transition_get_in( this ); - mlt_position out = mlt_transition_get_out( this ); - mlt_position time = mlt_frame_get_position( b_frame ); - double mix = ( double )( time - in ) / ( double )( out - in + 1 ); - mlt_properties_set_double( b_props, "audio.mix", mix ); - } - else - mlt_properties_set_double( b_props, "audio.mix", mlt_properties_get_double( properties, "mix" ) ); - mlt_properties_set_double( b_props, "audio.reverse", mlt_properties_get_double( properties, "reverse" ) ); - } - - // Backup the original get_audio (it's still needed) - mlt_properties_set_data( mlt_frame_properties( a_frame ), "mix.get_audio", a_frame->get_audio, 0, NULL, NULL ); - - // Override the get_audio method - a_frame->get_audio = transition_get_audio; - - mlt_frame_push_frame( a_frame, b_frame ); - - return a_frame; -} - -/** Constructor for the transition. -*/ - -mlt_transition transition_mix_init( char *arg ) -{ - mlt_transition this = calloc( sizeof( struct mlt_transition_s ), 1 ); - if ( this != NULL && mlt_transition_init( this, NULL ) == 0 ) - { - this->process = transition_process; - if ( arg != NULL ) - mlt_properties_set_double( mlt_transition_properties( this ), "mix", atof( arg ) ); - } - return this; -} - diff --git a/mlt/src/modules/core/transition_mix.h b/mlt/src/modules/core/transition_mix.h deleted file mode 100644 index 2ada6bc..0000000 --- a/mlt/src/modules/core/transition_mix.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * transition_mix.h -- mix two audio streams - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _TRANSITION_MIX_H_ -#define _TRANSITION_MIX_H_ - -#include - -extern mlt_transition transition_mix_init( char *arg ); - -#endif diff --git a/mlt/src/modules/dv/Makefile b/mlt/src/modules/dv/Makefile deleted file mode 100644 index f3aac3c..0000000 --- a/mlt/src/modules/dv/Makefile +++ /dev/null @@ -1,30 +0,0 @@ - -TARGET = ../libmltdv.so - -OBJS = factory.o \ - producer_libdv.o \ - consumer_libdv.o - -CFLAGS = -I../../ -Wall -g -D_FILE_OFFSET_BITS=64 -pthread - -LDFLAGS=-ldv -lpthread - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) -shared -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/modules/dv/configure b/mlt/src/modules/dv/configure deleted file mode 100755 index 9453267..0000000 --- a/mlt/src/modules/dv/configure +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -if [ "$help" != "1" ] -then - -cat << EOF >> ../producers.dat -libdv libmltdv.so -EOF - -cat << EOF >> ../consumers.dat -libdv libmltdv.so -EOF - -fi - diff --git a/mlt/src/modules/dv/consumer_libdv.c b/mlt/src/modules/dv/consumer_libdv.c deleted file mode 100644 index de64f46..0000000 --- a/mlt/src/modules/dv/consumer_libdv.c +++ /dev/null @@ -1,395 +0,0 @@ -/* - * producer_libdv.c -- a DV encoder based on libdv - * 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 program 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. - * - * 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. - */ - -// Local header files -#include "consumer_libdv.h" - -// mlt Header files -#include - -// System header files -#include -#include -#include -#include - -// libdv header files -#include - -// Forward references. -static int consumer_start( mlt_consumer this ); -static int consumer_stop( mlt_consumer this ); -static int consumer_is_stopped( mlt_consumer this ); -static int consumer_encode_video( mlt_consumer this, uint8_t *dv_frame, mlt_frame frame ); -static void consumer_encode_audio( mlt_consumer this, uint8_t *dv_frame, mlt_frame frame ); -static void consumer_output( mlt_consumer this, uint8_t *dv_frame, int size, mlt_frame frame ); -static void *consumer_thread( void *arg ); -static void consumer_close( mlt_consumer this ); - -/** Initialise the dv consumer. -*/ - -mlt_consumer consumer_libdv_init( char *arg ) -{ - // Allocate the consumer - mlt_consumer this = calloc( 1, sizeof( struct mlt_consumer_s ) ); - - // If memory allocated and initialises without error - if ( this != NULL && mlt_consumer_init( this, NULL ) == 0 ) - { - // Get properties from the consumer - mlt_properties properties = mlt_consumer_properties( this ); - - // Assign close callback - this->close = consumer_close; - - // Interpret the constructor argument - if ( arg == NULL || !strcmp( arg, "PAL" ) ) - mlt_properties_set_double( properties, "fps", 25 ); - else - mlt_properties_set_double( properties, "fps", 29.97 ); - - // Set the encode and output handling method - mlt_properties_set_data( properties, "video", consumer_encode_video, 0, NULL, NULL ); - mlt_properties_set_data( properties, "audio", consumer_encode_audio, 0, NULL, NULL ); - mlt_properties_set_data( properties, "output", consumer_output, 0, NULL, NULL ); - - // Set up start/stop/terminated callbacks - this->start = consumer_start; - this->stop = consumer_stop; - this->is_stopped = consumer_is_stopped; - } - else - { - // Clean up in case of init failure - free( this ); - this = NULL; - } - - // Return this - return this; -} - -/** Start the consumer. -*/ - -static int consumer_start( mlt_consumer this ) -{ - // Get the properties - mlt_properties properties = mlt_consumer_properties( this ); - - // Check that we're not already running - if ( !mlt_properties_get_int( properties, "running" ) ) - { - // Allocate a thread - pthread_t *thread = calloc( 1, sizeof( pthread_t ) ); - - // Assign the thread to properties - mlt_properties_set_data( properties, "thread", thread, sizeof( pthread_t ), free, NULL ); - - // Set the running state - mlt_properties_set_int( properties, "running", 1 ); - - // Create the thread - pthread_create( thread, NULL, consumer_thread, this ); - } - return 0; -} - -/** Stop the consumer. -*/ - -static int consumer_stop( mlt_consumer this ) -{ - // Get the properties - mlt_properties properties = mlt_consumer_properties( this ); - - // Check that we're running - if ( mlt_properties_get_int( properties, "running" ) ) - { - // Get the thread - pthread_t *thread = mlt_properties_get_data( properties, "thread", NULL ); - - // Stop the thread - mlt_properties_set_int( properties, "running", 0 ); - - // Wait for termination - pthread_join( *thread, NULL ); - } - - return 0; -} - -/** Determine if the consumer is stopped. -*/ - -static int consumer_is_stopped( mlt_consumer this ) -{ - // Get the properties - mlt_properties properties = mlt_consumer_properties( this ); - return !mlt_properties_get_int( properties, "running" ); -} - -/** Get or create a new libdv encoder. -*/ - -static dv_encoder_t *libdv_get_encoder( mlt_consumer this, mlt_frame frame ) -{ - // Get the properties of the consumer - mlt_properties this_properties = mlt_consumer_properties( this ); - - // Obtain the dv_encoder - dv_encoder_t *encoder = mlt_properties_get_data( this_properties, "dv_encoder", NULL ); - - // Construct one if we don't have one - if ( encoder == NULL ) - { - // Get the fps of the consumer (for now - should be from frame) - double fps = mlt_properties_get_double( this_properties, "fps" ); - - // Create the encoder - encoder = dv_encoder_new( 0, 0, 0 ); - - // Encoder settings - encoder->isPAL = fps == 25; - encoder->is16x9 = 0; - encoder->vlc_encode_passes = 1; - encoder->static_qno = 0; - encoder->force_dct = DV_DCT_AUTO; - - // Store the encoder on the properties - mlt_properties_set_data( this_properties, "dv_encoder", encoder, 0, ( mlt_destructor )dv_encoder_free, NULL ); - - // Convenience for image dimensions - mlt_properties_set_int( this_properties, "width", 720 ); - mlt_properties_set_int( this_properties, "height", fps == 25 ? 576 : 480 ); - } - - // Return the encoder - return encoder; -} - - -/** The libdv encode video method. -*/ - -static int consumer_encode_video( mlt_consumer this, uint8_t *dv_frame, mlt_frame frame ) -{ - // Obtain the dv_encoder - dv_encoder_t *encoder = libdv_get_encoder( this, frame ); - - // Get the properties of the consumer - mlt_properties this_properties = mlt_consumer_properties( this ); - - // This will hold the size of the dv frame - int size = 0; - - // determine if this a test card - int is_test = mlt_frame_is_test_card( frame ); - - // If we get an encoder, then encode the image - if ( encoder != NULL ) - { - // Specify desired image properties - mlt_image_format fmt = mlt_image_yuv422; - int width = mlt_properties_get_int( this_properties, "width" ); - int height = mlt_properties_get_int( this_properties, "height" ); - uint8_t *image = NULL; - - // Get the image - mlt_frame_get_image( frame, &image, &fmt, &width, &height, 0 ); - - // Check that we get what we expected - if ( fmt != mlt_image_yuv422 || - width != mlt_properties_get_int( this_properties, "width" ) || - height != mlt_properties_get_int( this_properties, "height" ) || - image == NULL ) - { - // We should try to recover here - fprintf( stderr, "We have a problem houston...\n" ); - } - else - { - // Calculate the size of the dv frame - size = height == 576 ? frame_size_625_50 : frame_size_525_60; - } - - // Process the frame - if ( size != 0 && !( mlt_properties_get_int( this_properties, "was_test_card" ) && is_test ) ) - { - // Encode the image - dv_encode_full_frame( encoder, &image, e_dv_color_yuv, dv_frame ); - - // Note test card status - mlt_properties_set_int( this_properties, "was_test_card", is_test ); - } - } - - return size; -} - -/** The libdv encode audio method. -*/ - -static void consumer_encode_audio( mlt_consumer this, uint8_t *dv_frame, mlt_frame frame ) -{ - // Get the properties of the consumer - mlt_properties this_properties = mlt_consumer_properties( this ); - - // Obtain the dv_encoder - dv_encoder_t *encoder = libdv_get_encoder( this, frame ); - - // Only continue if we have an encoder - if ( encoder != NULL ) - { - // Get the frame count - int count = mlt_properties_get_int( this_properties, "count" ); - - // Default audio args - mlt_audio_format fmt = mlt_audio_pcm; - int channels = 2; - int frequency = 48000; - int samples = mlt_sample_calculator( mlt_properties_get_double( this_properties, "fps" ), frequency, count ); - int16_t *pcm = NULL; - - // Get the frame number - time_t start = time( NULL ); - int height = mlt_properties_get_int( this_properties, "height" ); - int is_pal = height == 576; - int is_wide = 0; - - // Temporary - audio buffer allocation - int16_t *audio_buffers[ 4 ]; - int i = 0; - int j = 0; - for ( i = 0 ; i < 4; i ++ ) - audio_buffers[ i ] = malloc( 2 * DV_AUDIO_MAX_SAMPLES ); - - // Get the audio - mlt_frame_get_audio( frame, &pcm, &fmt, &frequency, &channels, &samples ); - - // Inform the encoder of the number of audio samples - encoder->samples_this_frame = samples; - - // Fill the audio buffers correctly - for ( i = 0; i < samples; i ++ ) - for ( j = 0; j < channels; j++ ) - audio_buffers[ j ][ i ] = *pcm ++; - - // Encode audio on frame - dv_encode_full_audio( encoder, audio_buffers, channels, frequency, dv_frame ); - - // Specify meta data on the frame - dv_encode_metadata( dv_frame, is_pal, is_wide, &start, count ); - dv_encode_timecode( dv_frame, is_pal, count ); - - // Update properties - mlt_properties_set_int( this_properties, "count", ++ count ); - - // Temporary - free audio buffers - for ( i = 0 ; i < 4; i ++ ) - free( audio_buffers[ i ] ); - } -} - -/** The libdv output method. -*/ - -static void consumer_output( mlt_consumer this, uint8_t *dv_frame, int size, mlt_frame frame ) -{ - fwrite( dv_frame, size, 1, stdout ); - fflush( stdout ); -} - -/** The main thread - the argument is simply the consumer. -*/ - -static void *consumer_thread( void *arg ) -{ - // Map the argument to the object - mlt_consumer this = arg; - - // Get the properties - mlt_properties properties = mlt_consumer_properties( this ); - - // Get the handling methods - int ( *video )( mlt_consumer, uint8_t *, mlt_frame ) = mlt_properties_get_data( properties, "video", NULL ); - int ( *audio )( mlt_consumer, uint8_t *, mlt_frame ) = mlt_properties_get_data( properties, "audio", NULL ); - int ( *output )( mlt_consumer, uint8_t *, int, mlt_frame ) = mlt_properties_get_data( properties, "output", NULL ); - - // Allocate a single PAL frame for encoding - uint8_t *dv_frame = malloc( frame_size_625_50 ); - - // Get the service associated to the consumer - mlt_service service = mlt_consumer_service( this ); - - // Define a frame pointer - mlt_frame frame; - - // Loop while running - while( mlt_properties_get_int( properties, "running" ) ) - { - // Get the frame - if ( mlt_service_get_frame( service, &frame, 0 ) == 0 ) - { - // Obtain the dv_encoder - if ( libdv_get_encoder( this, frame ) != NULL ) - { - // Encode the image - int size = video( this, dv_frame, frame ); - - // Encode the audio - if ( size > 0 ) - audio( this, dv_frame, frame ); - - // Output the frame - output( this, dv_frame, size, frame ); - - // Close the frame - mlt_frame_close( frame ); - } - else - { - fprintf( stderr, "Unable to obtain dv encoder.\n" ); - } - } - } - - // Tidy up - free( dv_frame ); - - return NULL; -} - -/** Close the consumer. -*/ - -static void consumer_close( mlt_consumer this ) -{ - // Stop the consumer - mlt_consumer_stop( this ); - - // Close the parent - mlt_consumer_close( this ); - - // Free the memory - free( this ); -} - diff --git a/mlt/src/modules/dv/consumer_libdv.h b/mlt/src/modules/dv/consumer_libdv.h deleted file mode 100644 index de7311e..0000000 --- a/mlt/src/modules/dv/consumer_libdv.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_libdv.h -- a DV encoder based on libdv - * 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 program 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. - * - * 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. - */ - -#ifndef _CONSUMER_LIBDV_H_ -#define _CONSUMER_LIBDV_H_ - -#include - -extern mlt_consumer consumer_libdv_init( char *filename ); - -#endif diff --git a/mlt/src/modules/dv/factory.c b/mlt/src/modules/dv/factory.c deleted file mode 100644 index 8d25f70..0000000 --- a/mlt/src/modules/dv/factory.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * factory.c -- the factory method interfaces - * 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 program 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. - * - * 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. - */ - -#include - -#include "producer_libdv.h" -#include "consumer_libdv.h" - -void *mlt_create_producer( char *id, void *arg ) -{ - if ( !strcmp( id, "libdv" ) ) - return producer_libdv_init( arg ); - return NULL; -} - -void *mlt_create_filter( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_transition( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_consumer( char *id, void *arg ) -{ - if ( !strcmp( id, "libdv" ) ) - return consumer_libdv_init( arg ); - return NULL; -} - diff --git a/mlt/src/modules/dv/producer_libdv.c b/mlt/src/modules/dv/producer_libdv.c deleted file mode 100644 index b82a0e6..0000000 --- a/mlt/src/modules/dv/producer_libdv.c +++ /dev/null @@ -1,336 +0,0 @@ -/* - * producer_libdv.c -- simple libdv test case - * 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 program 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. - * - * 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. - */ - -#include "producer_libdv.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -typedef struct producer_libdv_s *producer_libdv; - -struct producer_libdv_s -{ - struct mlt_producer_s parent; - int fd; - dv_decoder_t *dv_decoder; - int is_pal; - uint64_t file_size; - int frame_size; - long frames_in_file; -}; - -static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index ); -static void producer_close( mlt_producer parent ); - -static int producer_collect_info( producer_libdv this ); - -mlt_producer producer_libdv_init( char *filename ) -{ - producer_libdv this = calloc( sizeof( struct producer_libdv_s ), 1 ); - - if ( filename != NULL && this != NULL && mlt_producer_init( &this->parent, this ) == 0 ) - { - mlt_producer producer = &this->parent; - mlt_properties properties = mlt_producer_properties( producer ); - - // Register transport implementation with the producer - producer->close = producer_close; - - // Register our get_frame implementation with the producer - producer->get_frame = producer_get_frame; - - // Create the dv_decoder - this->dv_decoder = dv_decoder_new( FALSE, FALSE, FALSE ); - this->dv_decoder->quality = DV_QUALITY_BEST; - this->dv_decoder->audio->arg_audio_emphasis = 2; - dv_set_audio_correction( this->dv_decoder, DV_AUDIO_CORRECT_AVERAGE ); - - // Open the file if specified - this->fd = open( filename, O_RDONLY ); - producer_collect_info( this ); - - // Set the resource property (required for all producers) - mlt_properties_set( properties, "resource", filename ); - - // Return the producer - return producer; - } - free( this ); - return NULL; -} - -static int read_frame( int fd, uint8_t* frame_buf, int *isPAL ) -{ - int result = read( fd, frame_buf, frame_size_525_60 ) == frame_size_525_60; - if ( result ) - { - *isPAL = ( frame_buf[3] & 0x80 ); - - if ( *isPAL ) - { - int diff = frame_size_625_50 - frame_size_525_60; - result = read( fd, frame_buf + frame_size_525_60, diff ) == diff; - } - } - - return result; -} - -static int producer_collect_info( producer_libdv this ) -{ - int valid = 0; - uint8_t *dv_data = malloc( frame_size_625_50 ); - - if ( dv_data != NULL ) - { - // Read the first frame - valid = read_frame( this->fd, dv_data, &this->is_pal ); - - // If it looks like a valid frame, the get stats - if ( valid ) - { - // Get the properties - mlt_properties properties = mlt_producer_properties( &this->parent ); - - // Determine the file size - struct stat buf; - fstat( this->fd, &buf ); - - // Store the file size - this->file_size = buf.st_size; - - // Determine the frame size - this->frame_size = this->is_pal ? frame_size_625_50 : frame_size_525_60; - - // Determine the number of frames in the file - this->frames_in_file = this->file_size / this->frame_size; - - // Calculate default in/out points - double fps = this->is_pal ? 25 : 30000.0 / 1001.0; - mlt_properties_set_double( properties, "fps", fps ); - mlt_properties_set_position( properties, "length", this->frames_in_file ); - mlt_properties_set_position( properties, "in", 0 ); - mlt_properties_set_position( properties, "out", this->frames_in_file - 1 ); - - // Parse the header for meta info - dv_parse_header( this->dv_decoder, dv_data ); - mlt_properties_set_double( properties, "aspect_ratio", dv_format_wide( this->dv_decoder ) ? 16.0/9.0 : 4.0/3.0 ); - - // Set the speed to normal - mlt_properties_set_double( properties, "speed", 1 ); - } - - free( dv_data ); - } - - return valid; -} - -static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable ) -{ - int pitches[3] = { 0, 0, 0 }; - uint8_t *pixels[3] = { NULL, NULL, NULL }; - - // Get the frames properties - mlt_properties properties = mlt_frame_properties( this ); - - // Get the dv decoder - dv_decoder_t *decoder = mlt_properties_get_data( properties, "dv_decoder", NULL ); - - // Get the dv data - uint8_t *dv_data = mlt_properties_get_data( properties, "dv_data", NULL ); - - // Parse the header for meta info - dv_parse_header( decoder, dv_data ); - - // Assign width and height from properties - *width = mlt_properties_get_int( properties, "width" ); - *height = mlt_properties_get_int( properties, "height" ); - - // Extract an image of the format requested - if ( *format == mlt_image_yuv422 ) - { - // Allocate an image - uint8_t *image = malloc( *width * *height * 2 ); - - // Pass to properties for clean up - mlt_properties_set_data( properties, "image", image, *width * *height * 2, free, NULL ); - - // Decode the image - pitches[ 0 ] = *width * 2; - pixels[ 0 ] = image; - dv_decode_full_frame( decoder, dv_data, e_dv_color_yuv, pixels, pitches ); - - // Assign result - *buffer = image; - } - else if ( *format == mlt_image_rgb24 ) - { - // Allocate an image - uint8_t *image = malloc( *width * *height * 3 ); - - // Pass to properties for clean up - mlt_properties_set_data( properties, "image", image, *width * *height * 3, free, NULL ); - - // Decode the frame - pitches[ 0 ] = 720 * 3; - pixels[ 0 ] = image; - dv_decode_full_frame( decoder, dv_data, e_dv_color_rgb, pixels, pitches ); - - // Assign result - *buffer = image; - } - - return 0; -} - -static int producer_get_audio( mlt_frame this, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples ) -{ - int16_t *p; - int i, j; - int16_t *audio_channels[ 4 ]; - - // Get the frames properties - mlt_properties properties = mlt_frame_properties( this ); - - // Get the dv decoder - dv_decoder_t *decoder = mlt_properties_get_data( properties, "dv_decoder", NULL ); - - // Get the dv data - uint8_t *dv_data = mlt_properties_get_data( properties, "dv_data", NULL ); - - // Parse the header for meta info - dv_parse_header( decoder, dv_data ); - - // Obtain required values - *frequency = decoder->audio->frequency; - *samples = decoder->audio->samples_this_frame; - *channels = decoder->audio->num_channels; - - // Create a temporary workspace - for ( i = 0; i < 4; i++ ) - audio_channels[ i ] = malloc( DV_AUDIO_MAX_SAMPLES * sizeof( int16_t ) ); - - // Create a workspace for the result - *buffer = malloc( *channels * DV_AUDIO_MAX_SAMPLES * sizeof( int16_t ) ); - - // Pass the allocated audio buffer as a property - mlt_properties_set_data( properties, "audio", *buffer, *channels * DV_AUDIO_MAX_SAMPLES * sizeof( int16_t ), free, NULL ); - - // Decode the audio - dv_decode_full_audio( decoder, dv_data, audio_channels ); - - // Interleave the audio - p = *buffer; - for ( i = 0; i < *samples; i++ ) - for ( j = 0; j < *channels; j++ ) - *p++ = audio_channels[ j ][ i ]; - - // Free the temporary work space - for ( i = 0; i < 4; i++ ) - free( audio_channels[ i ] ); - - return 0; -} - -static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index ) -{ - producer_libdv this = producer->child; - uint8_t *data = malloc( frame_size_625_50 ); - - // Obtain the current frame number - uint64_t position = mlt_producer_frame( producer ); - - // Convert timecode to a file position (ensuring that we're on a frame boundary) - uint64_t offset = position * this->frame_size; - - // Create an empty frame - *frame = mlt_frame_init( ); - - // Seek and fetch - if ( this->fd != 0 && - lseek( this->fd, offset, SEEK_SET ) == offset && - read_frame( this->fd, data, &this->is_pal ) ) - { - // Get the frames properties - mlt_properties properties = mlt_frame_properties( *frame ); - - // Pass the dv decoder - mlt_properties_set_data( properties, "dv_decoder", this->dv_decoder, 0, NULL, NULL ); - - // Pass the dv data - mlt_properties_set_data( properties, "dv_data", data, frame_size_625_50, free, NULL ); - - // Update other info on the frame - mlt_properties_set_int( properties, "width", 720 ); - mlt_properties_set_int( properties, "height", this->is_pal ? 576 : 480 ); - mlt_properties_set_int( properties, "top_field_first", 0 ); - - // Parse the header for meta info - dv_parse_header( this->dv_decoder, data ); - mlt_properties_set_int( properties, "progressive", dv_is_progressive( this->dv_decoder ) ); - mlt_properties_set_double( properties, "aspect_ratio", dv_format_wide( this->dv_decoder ) ? 16.0/9.0 : 4.0/3.0 ); - - // Hmm - register audio callback - ( *frame )->get_audio = producer_get_audio; - - // Push the get_image method on to the stack - mlt_frame_push_get_image( *frame, producer_get_image ); - } - else - { - free( data ); - } - - // Update timecode on the frame we're creating - mlt_frame_set_position( *frame, mlt_producer_position( producer ) ); - - // Calculate the next timecode - mlt_producer_prepare_next( producer ); - - return 0; -} - -static void producer_close( mlt_producer parent ) -{ - // Obtain this - producer_libdv this = parent->child; - - // Free the dv deconder - //dv_decoder_free( this->dv_decoder ); - - // Close the file - if ( this->fd != 0 ) - close( this->fd ); - - // Close the parent - parent->close = NULL; - mlt_producer_close( parent ); - - // Free the memory - free( this ); -} - diff --git a/mlt/src/modules/dv/producer_libdv.h b/mlt/src/modules/dv/producer_libdv.h deleted file mode 100644 index c493eae..0000000 --- a/mlt/src/modules/dv/producer_libdv.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_libdv.h -- a DV decoder based on libdv - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _PRODUCER_LIBDV_H_ -#define _PRODUCER_LIBDV_H_ - -#include - -extern mlt_producer producer_libdv_init( char *filename ); - -#endif diff --git a/mlt/src/modules/ffmpeg/Makefile b/mlt/src/modules/ffmpeg/Makefile deleted file mode 100644 index 52c407b..0000000 --- a/mlt/src/modules/ffmpeg/Makefile +++ /dev/null @@ -1,29 +0,0 @@ - -TARGET = ../libmltffmpeg.so - -OBJS = factory.o \ - producer_ffmpeg.o \ - filter_ffmpeg_dub.o \ - consumer_ffmpeg.o - -CFLAGS = -I../../ -Wall -g -D_FILE_OFFSET_BITS=64 -pthread - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) -shared -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/modules/ffmpeg/audio.sh b/mlt/src/modules/ffmpeg/audio.sh deleted file mode 100755 index 2d6aeda..0000000 --- a/mlt/src/modules/ffmpeg/audio.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -trap exit - -audio_type="$1" -audio_file="$2" -audio_position=$3 -audio_frequency=$4 -audio_channels=$5 -audio_track=$5 - -if [ "$audio_type" == "dsp" ] -then ffmpeg -ad "$audio_file" -f s16le -ar $audio_frequency -ac $audio_channels - -else ffmpeg -i "$audio_file" -ss $audio_position -f s16le -ar $audio_frequency -ac $audio_channels - -fi - diff --git a/mlt/src/modules/ffmpeg/configure b/mlt/src/modules/ffmpeg/configure deleted file mode 100755 index 539ac5b..0000000 --- a/mlt/src/modules/ffmpeg/configure +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -if [ "$help" != "1" ] -then - -cat << EOF >> ../producers.dat -ffmpeg libmltffmpeg.so -EOF - -cat << EOF >> ../filters.dat -ffmpeg_dub libmltffmpeg.so -EOF - -cat << EOF >> ../consumers.dat -ffmpeg libmltffmpeg.so -EOF - -fi - diff --git a/mlt/src/modules/ffmpeg/consumer_ffmpeg.c b/mlt/src/modules/ffmpeg/consumer_ffmpeg.c deleted file mode 100644 index 11f72b7..0000000 --- a/mlt/src/modules/ffmpeg/consumer_ffmpeg.c +++ /dev/null @@ -1,279 +0,0 @@ -/* - * consumer_ffmpeg.c -- an ffmpeg consumer - * 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 program 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. - * - * 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. - */ - -#include "consumer_ffmpeg.h" -#include -#include -#include -#include -#include - -/** This classes definition. -*/ - -typedef struct consumer_ffmpeg_s *consumer_ffmpeg; - -struct consumer_ffmpeg_s -{ - struct mlt_consumer_s parent; - mlt_properties properties; - int format; - int video; - pthread_t thread; - int running; - uint8_t audio_buffer[ 4096 * 3 ]; - int audio_avail; - pthread_mutex_t audio_mutex; - pthread_cond_t audio_cond; - int window_width; - int window_height; - float aspect_ratio; - int width; - int height; - int playing; - mlt_frame *queue; - int size; - int count; - uint8_t *buffer; -}; - -/** Forward references to static functions. -*/ - -static void consumer_close( mlt_consumer parent ); -static void *consumer_thread( void * ); - -/** This is what will be called by the factory - anything can be passed in - via the argument, but keep it simple. -*/ - -mlt_consumer consumer_ffmpeg_init( char *arg ) -{ - // Create the consumer object - consumer_ffmpeg this = calloc( sizeof( struct consumer_ffmpeg_s ), 1 ); - - // If no malloc'd and consumer init ok - if ( this != NULL && mlt_consumer_init( &this->parent, this ) == 0 ) - { - // Get the parent consumer object - mlt_consumer parent = &this->parent; - - // We have stuff to clean up, so override the close method - parent->close = consumer_close; - - // get a handle on properties - mlt_service service = mlt_consumer_service( parent ); - this->properties = mlt_service_properties( service ); - - // This is the initialisation of the consumer - this->running = 1; - pthread_mutex_init( &this->audio_mutex, NULL ); - pthread_cond_init( &this->audio_cond, NULL); - - // process actual param - if ( arg == NULL || !strcmp( arg, "-" ) ) - { - mlt_properties_set( this->properties, "video_file", "-" ); - mlt_properties_set( this->properties, "video_format", "dv" ); - } - else - { - mlt_properties_set( this->properties, "video_file", arg ); - mlt_properties_set( this->properties, "video_format", "" ); - } - - // Create the the thread - pthread_create( &this->thread, NULL, consumer_thread, this ); - - // Return the consumer produced - return parent; - } - - // malloc or consumer init failed - free( this ); - - // Indicate failure - return NULL; -} - -static void sdl_fill_audio( void *udata, uint8_t *stream, int len ) -{ - consumer_ffmpeg this = udata; - - pthread_mutex_lock( &this->audio_mutex ); - - // Block until audio received - while ( this->running && len > this->audio_avail ) - pthread_cond_wait( &this->audio_cond, &this->audio_mutex ); - - if ( this->audio_avail >= len ) - { - // Remove len from the audio available - this->audio_avail -= len; - - // Remove the samples - memmove( this->audio_buffer, this->audio_buffer + len, this->audio_avail ); - } - else - { - // Just to be safe, wipe the stream first - memset( stream, 0, len ); - - // Copy what we have into the stream - memcpy( stream, this->audio_buffer, this->audio_avail ); - - // No audio left - this->audio_avail = 0; - } - - pthread_cond_broadcast( &this->audio_cond ); - pthread_mutex_unlock( &this->audio_mutex ); -} - -static int consumer_play_audio( consumer_ffmpeg this, mlt_frame frame, int init_audio ) -{ - // Get the properties of this consumer - mlt_properties properties = this->properties; - mlt_audio_format afmt = mlt_audio_pcm; - int channels; - int samples; - int frequency; - int16_t *pcm; - int bytes; - - mlt_frame_get_audio( frame, &pcm, &afmt, &frequency, &channels, &samples ); - - if ( mlt_properties_get_int( properties, "audio_off" ) ) - return init_audio; - - if ( init_audio == 0 ) - { - bytes = ( samples * channels * 2 ); - pthread_mutex_lock( &this->audio_mutex ); - while ( bytes > ( sizeof( this->audio_buffer) - this->audio_avail ) ) - pthread_cond_wait( &this->audio_cond, &this->audio_mutex ); - mlt_properties properties = mlt_frame_properties( frame ); - if ( mlt_properties_get_double( properties, "speed" ) == 1 ) - memcpy( &this->audio_buffer[ this->audio_avail ], pcm, bytes ); - else - memset( &this->audio_buffer[ this->audio_avail ], 0, bytes ); - this->audio_avail += bytes; - pthread_cond_broadcast( &this->audio_cond ); - pthread_mutex_unlock( &this->audio_mutex ); - } - else - { - this->playing = 1; - } - - return init_audio; -} - -static int consumer_play_video( consumer_ffmpeg this, mlt_frame frame ) -{ - // Get the properties of this consumer - mlt_properties properties = this->properties; - - if ( mlt_properties_get_int( properties, "video_off" ) ) - { - mlt_frame_close( frame ); - return 0; - } - - if ( this->count == this->size ) - { - this->size += 25; - this->queue = realloc( this->queue, sizeof( mlt_frame ) * this->size ); - } - this->queue[ this->count ++ ] = frame; - - // We're working on the oldest frame now - frame = this->queue[ 0 ]; - - // Shunt the frames in the queue down - int i = 0; - for ( i = 1; i < this->count; i ++ ) - this->queue[ i - 1 ] = this->queue[ i ]; - this->count --; - - return 0; -} - -/** Threaded wrapper for pipe. -*/ - -static void *consumer_thread( void *arg ) -{ - // Identify the arg - consumer_ffmpeg this = arg; - - // Get the consumer - mlt_consumer consumer = &this->parent; - - // Get the service assoicated to the consumer - mlt_service service = mlt_consumer_service( consumer ); - - // Define a frame pointer - mlt_frame frame; - - // internal intialization - int init_audio = 1; - - // Loop until told not to - while( this->running ) - { - // Get a frame from the service (should never return anything other than 0) - if ( mlt_service_get_frame( service, &frame, 0 ) == 0 ) - { - init_audio = consumer_play_audio( this, frame, init_audio ); - consumer_play_video( this, frame ); - } - } - - return NULL; -} - -/** Callback to allow override of the close method. -*/ - -static void consumer_close( mlt_consumer parent ) -{ - // Get the actual object - consumer_ffmpeg this = parent->child; - - // Kill the thread and clean up - this->running = 0; - - pthread_mutex_lock( &this->audio_mutex ); - pthread_cond_broadcast( &this->audio_cond ); - pthread_mutex_unlock( &this->audio_mutex ); - - pthread_join( this->thread, NULL ); - pthread_mutex_destroy( &this->audio_mutex ); - pthread_cond_destroy( &this->audio_cond ); - - // Now clean up the rest (the close = NULL is a bit nasty but needed for now) - parent->close = NULL; - mlt_consumer_close( parent ); - - // Finally clean up this - free( this ); -} - diff --git a/mlt/src/modules/ffmpeg/consumer_ffmpeg.h b/mlt/src/modules/ffmpeg/consumer_ffmpeg.h deleted file mode 100644 index dc2fc79..0000000 --- a/mlt/src/modules/ffmpeg/consumer_ffmpeg.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * consumer_ffmpeg.h -- simple ffmpeg test case - * 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 program 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. - * - * 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. - */ - -#ifndef _CONSUMER_FFMPEG_H_ -#define _CONSUMER_FFMPEG_H_ - -#include - -extern mlt_consumer consumer_ffmpeg_init( char *file ); - -#endif diff --git a/mlt/src/modules/ffmpeg/factory.c b/mlt/src/modules/ffmpeg/factory.c deleted file mode 100644 index 7bf697a..0000000 --- a/mlt/src/modules/ffmpeg/factory.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * factory.c -- the factory method interfaces - * 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 program 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. - * - * 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. - */ - -#include - -#include "producer_ffmpeg.h" -#include "filter_ffmpeg_dub.h" -#include "consumer_ffmpeg.h" - -void *mlt_create_producer( char *id, void *arg ) -{ - if ( !strcmp( id, "ffmpeg" ) ) - return producer_ffmpeg_init( arg ); - return NULL; -} - -void *mlt_create_filter( char *id, void *arg ) -{ - if ( !strcmp( id, "ffmpeg_dub" ) ) - return filter_ffmpeg_dub_init( arg ); - return NULL; -} - -void *mlt_create_transition( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_consumer( char *id, void *arg ) -{ - if ( !strcmp( id, "ffmpeg" ) ) - return consumer_ffmpeg_init( arg ); - return NULL; -} - diff --git a/mlt/src/modules/ffmpeg/filter_ffmpeg_dub.c b/mlt/src/modules/ffmpeg/filter_ffmpeg_dub.c deleted file mode 100644 index 0d678af..0000000 --- a/mlt/src/modules/ffmpeg/filter_ffmpeg_dub.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - * filter_ffmpeg_dub.c -- simple ffmpeg dub test case - * 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 program 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. - * - * 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. - */ - -#include "filter_ffmpeg_dub.h" -#include -#include -#include - -/** Do it. -*/ - -static int filter_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples ) -{ - // Obtain the frame properties - mlt_properties frame_properties = mlt_frame_properties( frame ); - - // Get the producer used. - mlt_producer producer = mlt_properties_get_data( frame_properties, "producer", NULL ); - - // Get the producer properties - mlt_properties producer_properties = mlt_producer_properties( producer ); - - // Get the original get_audio - frame->get_audio = mlt_properties_get_data( frame_properties, "get_audio", NULL ); - - // Call the original get_audio - mlt_frame_get_audio( frame, buffer, format, frequency, channels, samples ); - - // Now if our producer is still producing, override the audio - if ( !mlt_properties_get_int( producer_properties, "end_of_clip" ) ) - { - // Get the position - mlt_position position = mlt_properties_get_position( producer_properties, "dub_position" ); - - // We need a frame from the producer - mlt_frame producer_frame; - - // Set the FPS - mlt_properties_set_double( producer_properties, "fps", mlt_properties_get_double( frame_properties, "fps" ) ); - - // Seek to the position - mlt_producer_seek( producer, position ); - - // Get the next frame - producer->get_frame( producer, &producer_frame, 0 ); - - if ( !mlt_properties_get_int( producer_properties, "end_of_clip" ) ) - { - // Now get the audio from this frame - producer_frame->get_audio( producer_frame, buffer, format, frequency, channels, samples ); - - // This producer frame will be destroyed automatically when frame is destroyed - mlt_properties_set_data( frame_properties, "ffmpeg_dub_frame", producer_frame, 0, ( mlt_destructor )mlt_frame_close, NULL ); - - // Incrment the position - mlt_properties_set_position( producer_properties, "dub_position", position + 1 ); - } - } - - return 0; -} - -/** Filter processing. -*/ - -static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) -{ - // Obtain the filter properties - mlt_properties filter_properties = mlt_filter_properties( this ); - - // Get the producer used. - mlt_producer producer = mlt_properties_get_data( filter_properties, "producer", NULL ); - - // Obtain the frame properties - mlt_properties frame_properties = mlt_frame_properties( frame ); - - // Get the producer properties - mlt_properties producer_properties = mlt_producer_properties( producer ); - - // Only do this if we have not reached end of clip and ffmpeg_dub has not already been done - if ( !mlt_properties_get_int( producer_properties, "end_of_clip" ) && - mlt_properties_get_data( frame_properties, "get_audio", NULL ) == NULL ) - { - // Backup the original get_audio (it's still needed) - mlt_properties_set_data( frame_properties, "get_audio", frame->get_audio, 0, NULL, NULL ); - - // Pass the producer on the frame - mlt_properties_set_data( frame_properties, "producer", producer, 0, NULL, NULL ); - - // Override the get_audio method - frame->get_audio = filter_get_audio; - } - - return frame; -} - -/** Constructor for the filter. -*/ - -mlt_filter filter_ffmpeg_dub_init( char *file ) -{ - // Create the filter object - mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 ); - - // Initialise it - mlt_filter_init( this, NULL ); - - // Overide the filter process method - this->process = filter_process; - - // Obtain the properties - mlt_properties properties = mlt_filter_properties( this ); - - // Create an ffmpeg producer - mlt_producer producer = mlt_factory_producer( "ffmpeg", file ); - - // Pass the producer - mlt_properties_set_data( properties, "producer", producer, 0, ( mlt_destructor )mlt_producer_close, NULL ); - - // Initialise the audio frame position - mlt_properties_set_position( properties, "dub_position", 0 ); - - return this; -} - diff --git a/mlt/src/modules/ffmpeg/filter_ffmpeg_dub.h b/mlt/src/modules/ffmpeg/filter_ffmpeg_dub.h deleted file mode 100644 index 688d01b..0000000 --- a/mlt/src/modules/ffmpeg/filter_ffmpeg_dub.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_ffmpeg_dub.h -- simple ffmpeg dub test case - * 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 program 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. - * - * 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. - */ - -#ifndef _FILTER_FFMPEG_DUB_H_ -#define _FILTER_FFMPEG_DUB_H_ - -#include - -extern mlt_filter filter_ffmpeg_dub_init( char *file ); - -#endif diff --git a/mlt/src/modules/ffmpeg/producer_ffmpeg.c b/mlt/src/modules/ffmpeg/producer_ffmpeg.c deleted file mode 100644 index 15b1c89..0000000 --- a/mlt/src/modules/ffmpeg/producer_ffmpeg.c +++ /dev/null @@ -1,555 +0,0 @@ -/* - * producer_ffmpeg.c -- simple ffmpeg test case - * 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 program 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. - * - * 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. - */ - -#include "producer_ffmpeg.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -typedef struct producer_ffmpeg_s *producer_ffmpeg; - -/** Bi-directional pipe structure. -*/ - -typedef struct rwpipe -{ - int pid; - FILE *reader; - FILE *writer; -} -rwpipe; - -/** Create a bidirectional pipe for the given command. -*/ - -rwpipe *rwpipe_open( char *command ) -{ - rwpipe *this = malloc( sizeof( rwpipe ) ); - - if ( this != NULL ) - { - int input[ 2 ]; - int output[ 2 ]; - - pipe( input ); - pipe( output ); - - this->pid = fork(); - - if ( this->pid == 0 ) - { - signal( SIGPIPE, SIG_DFL ); - signal( SIGHUP, SIG_DFL ); - signal( SIGINT, SIG_DFL ); - signal( SIGTERM, SIG_DFL ); - signal( SIGSTOP, SIG_DFL ); - signal( SIGCHLD, SIG_DFL ); - - dup2( output[ 0 ], STDIN_FILENO ); - dup2( input[ 1 ], STDOUT_FILENO ); - - close( input[ 0 ] ); - close( input[ 1 ] ); - close( output[ 0 ] ); - close( output[ 1 ] ); - - execl( "/bin/sh", "sh", "-c", command, NULL ); - exit( 255 ); - } - else - { - setpgid( this->pid, this->pid ); - - close( input[ 1 ] ); - close( output[ 0 ] ); - - this->reader = fdopen( input[ 0 ], "r" ); - this->writer = fdopen( output[ 1 ], "w" ); - } - } - - return this; -} - -/** Read data from the pipe. -*/ - -FILE *rwpipe_reader( rwpipe *this ) -{ - if ( this != NULL ) - return this->reader; - else - return NULL; -} - -/** Write data to the pipe. -*/ - -FILE *rwpipe_writer( rwpipe *this ) -{ - if ( this != NULL ) - return this->writer; - else - return NULL; -} - -/** Close the pipe and process. -*/ - -void rwpipe_close( rwpipe *this ) -{ - if ( this != NULL ) - { - fclose( this->reader ); - fclose( this->writer ); - kill( - this->pid, SIGKILL ); - waitpid( - this->pid, NULL, 0 ); - free( this ); - } -} - -struct producer_ffmpeg_s -{ - struct mlt_producer_s parent; - rwpipe *video_pipe; - rwpipe *audio_pipe; - FILE *video; - FILE *audio; - uint64_t expected; - uint8_t *buffer; - int open; - int width; - int height; - int end_of_video; - int end_of_audio; -}; - -static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index ); -static void producer_close( mlt_producer parent ); - -/** Consutruct an ffmpeg producer. -*/ - -mlt_producer producer_ffmpeg_init( char *file ) -{ - producer_ffmpeg this = calloc( sizeof( struct producer_ffmpeg_s ), 1 ); - if ( file != NULL && this != NULL && mlt_producer_init( &this->parent, this ) == 0 ) - { - int usable = 1; - - // Get the producer - mlt_producer producer = &this->parent; - - // Get the properties of the producer - mlt_properties properties = mlt_producer_properties( producer ); - - // Override get_frame and close methods - producer->get_frame = producer_get_frame; - producer->close = producer_close; - - // Set the properties - mlt_properties_set( properties, "mlt_type", "producer_ffmpeg" ); - - if ( !strcmp( file, "v4l" ) ) - { - mlt_properties_set( properties, "video_type", "v4l" ); - mlt_properties_set( properties, "video_file", "/dev/video0" ); - mlt_properties_set( properties, "video_size", "640x480" ); - mlt_properties_set( properties, "audio_type", "dsp" ); - mlt_properties_set( properties, "audio_file", "/dev/dsp" ); - } - else - { - struct stat buf; - if ( stat( file, &buf ) != 0 || !S_ISREG( buf.st_mode ) ) - usable = 0; - mlt_properties_set( properties, "video_type", "file" ); - mlt_properties_set( properties, "video_file", file ); - mlt_properties_set( properties, "video_size", "" ); - mlt_properties_set( properties, "audio_type", "file" ); - mlt_properties_set( properties, "audio_file", file ); - } - - mlt_properties_set_int( properties, "audio_rate", 48000 ); - mlt_properties_set_int( properties, "audio_channels", 2 ); - mlt_properties_set_int( properties, "audio_track", 0 ); - - mlt_properties_set( properties, "log_id", file ); - mlt_properties_set( properties, "resource", file ); - mlt_properties_set_position( properties, "length", 36000 ); - mlt_properties_set_position( properties, "out", 36000 ); - - this->buffer = malloc( 1024 * 1024 * 2 ); - - if ( !usable ) - { - mlt_producer_close( &this->parent ); - producer = NULL; - } - - return producer; - } - free( this ); - return NULL; -} - -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 ); - - if ( mlt_properties_get_int( properties, "has_image" ) ) - { - // Get width and height - *format = mlt_image_yuv422; - *width = mlt_properties_get_int( properties, "width" ); - *height = mlt_properties_get_int( properties, "height" ); - - // Specify format and image - *buffer = mlt_properties_get_data( properties, "image", NULL ); - } - else - { - mlt_frame_get_image( this, buffer, format, width, height, writable ); - } - - return 0; -} - -FILE *producer_ffmpeg_run_video( producer_ffmpeg this, mlt_position position ) -{ - if ( this->video == NULL ) - { - // Get the producer - mlt_producer producer = &this->parent; - - // Get the properties of the producer - mlt_properties properties = mlt_producer_properties( producer ); - - // Get the video loop property - int video_loop = mlt_properties_get_int( properties, "video_loop" ); - - if ( !this->open || video_loop ) - { - const char *mlt_prefix = mlt_factory_prefix( ); - char *video_type = mlt_properties_get( properties, "video_type" ); - char *video_file = mlt_properties_get( properties, "video_file" ); - float video_rate = mlt_properties_get_double( properties, "fps" ); - char *video_size = mlt_properties_get( properties, "video_size" ); - char command[ 1024 ] = ""; - - sprintf( command, "%s/ffmpeg/video.sh \"%s\" \"%s\" \"%s\" %f %f 2>/dev/null", - mlt_prefix, - video_type, - video_file, - video_size, - video_rate, - ( float )position ); - - this->video_pipe = rwpipe_open( command ); - this->video = rwpipe_reader( this->video_pipe ); - } - } - return this->video; -} - -FILE *producer_ffmpeg_run_audio( producer_ffmpeg this, mlt_position position ) -{ - // Get the producer - mlt_producer producer = &this->parent; - - // Get the properties of the producer - mlt_properties properties = mlt_producer_properties( producer ); - - if ( this->audio == NULL ) - { - int audio_loop = mlt_properties_get_int( properties, "audio_loop" ); - - if ( !this->open || audio_loop ) - { - const char *mlt_prefix = mlt_factory_prefix( ); - char *audio_type = mlt_properties_get( properties, "audio_type" ); - char *audio_file = mlt_properties_get( properties, "audio_file" ); - int frequency = mlt_properties_get_int( properties, "audio_rate" ); - int channels = mlt_properties_get_int( properties, "audio_channels" ); - int track = mlt_properties_get_int( properties, "audio_track" ); - char command[ 1024 ] = ""; - - sprintf( command, "%s/ffmpeg/audio.sh \"%s\" \"%s\" %f %d %d %d 2>/dev/null", - mlt_prefix, - audio_type, - audio_file, - ( float )position, - frequency, - channels, - track ); - - this->audio_pipe = rwpipe_open( command ); - this->audio = rwpipe_reader( this->audio_pipe ); - } - } - return this->audio; -} - -static void producer_ffmpeg_position( producer_ffmpeg this, uint64_t requested, int *skip ) -{ - *skip = 0; - - if ( this->open && requested > this->expected ) - { - // Skip the following n frames - *skip = requested - this->expected; - } - else if ( requested != this->expected ) - { - // Close the video pipe - if ( this->video != NULL ) - rwpipe_close( this->video_pipe ); - this->video = NULL; - - // Close the audio pipe - if ( this->audio != NULL ) - rwpipe_close( this->audio_pipe ); - this->audio = NULL; - - // We should not be open now - this->open = 0; - this->end_of_video = 0; - this->end_of_audio = 0; - } - - // This is the next frame we expect - this->expected = requested + 1; - - // Open the pipe - this->video = producer_ffmpeg_run_video( this, 0 ); - - // Open the audio pipe - this->audio = producer_ffmpeg_run_audio( this, 0 ); - - // We should be open now - this->open = 1; -} - -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 ); - - producer_ffmpeg producer = mlt_properties_get_data( properties, "producer_ffmpeg", NULL ); - mlt_properties producer_properties = mlt_producer_properties( &producer->parent ); - - int64_t target = mlt_properties_get_double( properties, "target" ); - int skip = mlt_properties_get_int( properties, "skip" ); - - float fps = mlt_properties_get_double( producer_properties, "fps" ); - *frequency = mlt_properties_get_int( producer_properties, "audio_rate" ); - *channels = mlt_properties_get_int( producer_properties, "audio_channels" ); - - // Maximum Size (?) - int size = ( *frequency / 25 ) * *channels * 2; - - // Allocate an image - *buffer = malloc( size ); - - // Read it - if ( producer->audio != NULL ) - { - do - { - *samples = mlt_sample_calculator( fps, *frequency, target - skip ); - if ( fread( *buffer, *samples * *channels * 2, 1, producer->audio ) != 1 ) - { - rwpipe_close( producer->audio_pipe ); - producer->audio = NULL; - producer->end_of_audio = 1; - } - } - while( producer->audio != NULL && skip -- ); - } - else - { - *samples = mlt_sample_calculator( fps, *frequency, target ); - memset( *buffer, 0, size ); - } - - // Pass the data on the frame properties - mlt_properties_set_data( properties, "audio", *buffer, size, free, NULL ); - - // Set the producer properties - mlt_properties_set_int( producer_properties, "end_of_clip", producer->end_of_video && producer->end_of_audio ); - - return 0; -} - -static int read_ffmpeg_header( producer_ffmpeg this, int *width, int *height ) -{ - int count = 0; - char temp[ 132 ]; - FILE *video = this->video; - - if ( fgets( temp, 132, video ) ) - { - if ( strncmp( temp, "FRAME", 5 ) ) - { - if ( strstr( temp, " W" ) != NULL ) - *width = atoi( strstr( temp, " W" ) + 2 ); - if ( strstr( temp, " H" ) != NULL ) - *height = atoi( strstr( temp, " H" ) + 2 ); - count = 2; - fgets( temp, 132, video ); - this->width = *width; - this->height = *height; - } - else - { - *width = this->width; - *height = this->height; - count = 2; - } - } - return count; -} - -static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index ) -{ - producer_ffmpeg this = producer->child; - int width; - int height; - int skip; - - // Construct a test frame - *frame = mlt_frame_init( ); - - // Are we at the position expected? - producer_ffmpeg_position( this, mlt_producer_frame( producer ), &skip ); - - // Get properties objects - mlt_properties producer_properties = mlt_producer_properties( &this->parent ); - - // Get the frames properties - mlt_properties properties = mlt_frame_properties( *frame ); - - FILE *video = this->video; - - mlt_properties_set_double( properties, "target", mlt_producer_frame( producer ) ); - mlt_properties_set_int( properties, "skip", skip ); - - // Read the video - if ( video != NULL && read_ffmpeg_header( this, &width, &height ) == 2 ) - { - // Allocate an image - uint8_t *image = malloc( width * height * 2 ); - - // Read it - while( skip -- ) - { - if ( fread( this->buffer, width * height * 3 / 2, 1, video ) == 1 ) - read_ffmpeg_header( this, &width, &height ); - else - skip = 0; - } - - fread( this->buffer, width * height * 3 / 2, 1, video ); - - // Convert it - mlt_convert_yuv420p_to_yuv422( this->buffer, width, height, width, image ); - - // Pass the data on the frame properties - mlt_properties_set_data( properties, "image", image, width * height * 2, free, NULL ); - mlt_properties_set_int( properties, "width", width ); - mlt_properties_set_int( properties, "height", height ); - mlt_properties_set_int( properties, "has_image", 1 ); - - // Push the image callback - mlt_frame_push_get_image( *frame, producer_get_image ); - } - else - { - // Clean up - if ( this->video != NULL ) - { - int video_loop = mlt_properties_get_int( producer_properties, "video_loop" ); - - // Inform caller that end of clip is reached - this->end_of_video = !video_loop; - rwpipe_close( this->video_pipe ); - this->video = NULL; - } - - // Push the image callback - if ( !this->end_of_video ) - mlt_frame_push_get_image( *frame, producer_get_image ); - } - - // Set the audio pipe - mlt_properties_set_data( properties, "producer_ffmpeg", this, 0, NULL, NULL ); - - // Hmm - register audio callback - if ( !this->end_of_audio ) - ( *frame )->get_audio = producer_get_audio; - - // Get the additional properties - double aspect_ratio = mlt_properties_get_double( producer_properties, "aspect_ratio" ); - double speed = mlt_properties_get_double( producer_properties, "speed" ); - - // Set them on the frame - mlt_properties_set_double( properties, "aspect_ratio", aspect_ratio ); - mlt_properties_set_double( properties, "speed", speed ); - - // Set the out point on the producer - if ( this->end_of_video && this->end_of_audio ) - { - mlt_properties_set_int( properties, "end_of_clip", 1 ); - mlt_properties_set_position( producer_properties, "length", mlt_producer_position( &this->parent ) ); - mlt_producer_set_in_and_out( &this->parent, mlt_producer_get_in( &this->parent ), mlt_producer_position( &this->parent ) ); - } - - // Update timecode on the frame we're creating - mlt_frame_set_position( *frame, mlt_producer_position( producer ) ); - - // Calculate the next timecode - mlt_producer_prepare_next( producer ); - - return 0; -} - -static void producer_close( mlt_producer parent ) -{ - producer_ffmpeg this = parent->child; - if ( this->video ) - rwpipe_close( this->video_pipe ); - if ( this->audio ) - rwpipe_close( this->audio_pipe ); - parent->close = NULL; - mlt_producer_close( parent ); - free( this->buffer ); - free( this ); -} - diff --git a/mlt/src/modules/ffmpeg/producer_ffmpeg.h b/mlt/src/modules/ffmpeg/producer_ffmpeg.h deleted file mode 100644 index b283850..0000000 --- a/mlt/src/modules/ffmpeg/producer_ffmpeg.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_ffmpeg.h -- simple ffmpeg test case - * 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 program 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. - * - * 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. - */ - -#ifndef _PRODUCER_FFMPEG_H_ -#define _PRODUCER_FFMPEG_H_ - -#include - -extern mlt_producer producer_ffmpeg_init( char *file ); - -#endif diff --git a/mlt/src/modules/ffmpeg/video.sh b/mlt/src/modules/ffmpeg/video.sh deleted file mode 100755 index f8689fe..0000000 --- a/mlt/src/modules/ffmpeg/video.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -trap exit - -video_type="$1" -video_file="$2" -video_size="$3" -video_fps=$4 -video_position=$5 - -[ "$video_size" != "" ] && video_size="-s "$video_size - -if [ "$video_type" == "v4l" ] -then ffmpeg -vd "$video_file" -r $video_fps $video_size -f imagepipe -f yuv4mpegpipe - -else ffmpeg -i "$video_file" -ss $video_position -f imagepipe -r $video_fps $video_size -f yuv4mpegpipe - -fi diff --git a/mlt/src/modules/gtk2/Makefile b/mlt/src/modules/gtk2/Makefile deleted file mode 100644 index 3130918..0000000 --- a/mlt/src/modules/gtk2/Makefile +++ /dev/null @@ -1,30 +0,0 @@ - -TARGET = ../libmltgtk2.so - -OBJS = factory.o \ - producer_pixbuf.o \ - producer_pango.o - -CFLAGS = `pkg-config gdk-pixbuf-2.0 --cflags` `pkg-config pangoft2 --cflags` -I../../ -Wall -g -D_FILE_OFFSET_BITS=64 -pthread - -LDFLAGS = `pkg-config gdk-pixbuf-2.0 --libs` `pkg-config pangoft2 --libs` - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) -shared -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/modules/gtk2/configure b/mlt/src/modules/gtk2/configure deleted file mode 100755 index 04a232a..0000000 --- a/mlt/src/modules/gtk2/configure +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -if [ "$help" != "1" ] -then - -cat << EOF >> ../producers.dat -pixbuf libmltgtk2.so -pango libmltgtk2.so -EOF - -fi - diff --git a/mlt/src/modules/gtk2/factory.c b/mlt/src/modules/gtk2/factory.c deleted file mode 100644 index 38e1692..0000000 --- a/mlt/src/modules/gtk2/factory.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * factory.c -- the factory method interfaces - * 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 program 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. - * - * 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. - */ - -#include - -#include "producer_pixbuf.h" -#include "producer_pango.h" - -void *mlt_create_producer( char *id, void *arg ) -{ - if ( !strcmp( id, "pixbuf" ) ) - return producer_pixbuf_init( arg ); - else if ( !strcmp( id, "pango" ) ) - return producer_pango_init( arg ); - return NULL; -} - -void *mlt_create_filter( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_transition( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_consumer( char *id, void *arg ) -{ - return NULL; -} - diff --git a/mlt/src/modules/gtk2/producer_pango.c b/mlt/src/modules/gtk2/producer_pango.c deleted file mode 100644 index f1952dc..0000000 --- a/mlt/src/modules/gtk2/producer_pango.c +++ /dev/null @@ -1,452 +0,0 @@ -/* - * producer_pango.c -- a pango-based titler - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#include "producer_pango.h" -#include -#include -#include -#include -#include -#include - -struct producer_pango_s -{ - struct mlt_producer_s parent; - int width; - int height; - uint8_t *image; - uint8_t *alpha; - int fgcolor; - int bgcolor; - int align; - int pad; - char *markup; - char *text; - char *font; -}; - -// special color type used by internal pango routines -typedef struct -{ - uint8_t r, g, b, a; -} rgba_color; - -// Forward declarations -static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index ); -static void producer_close( mlt_producer parent ); -static void pango_draw_background( GdkPixbuf *pixbuf, rgba_color bg ); -static GdkPixbuf *pango_get_pixbuf( const char *markup, const char *text, const char *font, - rgba_color fg, rgba_color bg, int pad, int align ); - -mlt_producer producer_pango_init( const char *filename ) -{ - producer_pango this = calloc( sizeof( struct producer_pango_s ), 1 ); - if ( this != NULL && mlt_producer_init( &this->parent, this ) == 0 ) - { - mlt_producer producer = &this->parent; - - producer->get_frame = producer_get_frame; - producer->close = producer_close; - - // This is required to initialise gdk-pixbuf - g_type_init(); - - // Get the properties interface - mlt_properties properties = mlt_producer_properties( &this->parent ); - - // Set the default properties - mlt_properties_set_int( properties, "video_standard", mlt_video_standard_pal ); - mlt_properties_set_int( properties, "fgcolor", 0xffffffff ); - mlt_properties_set_int( properties, "bgcolor", 0x00000000 ); - mlt_properties_set_int( properties, "align", pango_align_left ); - mlt_properties_set_int( properties, "pad", 0 ); - mlt_properties_set( properties, "text", "" ); - mlt_properties_set( properties, "font", "Sans 48" ); - mlt_properties_set_int( properties, "x", 0 ); - mlt_properties_set_int( properties, "y", 0 ); - mlt_properties_set_double( properties, "mix", 1.0 ); - - if ( filename == NULL ) - { - mlt_properties_set( properties, "resource", "pango" ); - mlt_properties_set( properties, "markup", "" ); - } - else - { - FILE *f = fopen( filename, "r" ); - if ( f != NULL ) - { - char line[81]; - char *markup = NULL; - size_t size = 0; - line[80] = '\0'; - - while ( fgets( line, 80, f ) ) - { - size += strlen( line ) + 1; - if ( markup ) - { - realloc( markup, size ); - strcat( markup, line ); - } - else - { - markup = strdup( line ); - } - } - fclose( f ); - mlt_properties_set( properties, "resource", ( char * ) filename ); - mlt_properties_set( properties, "markup", ( char * ) ( markup == NULL ? "" : markup ) ); - if ( markup ) - free( markup ); - } - else - { - mlt_properties_set( properties, "resource", "pango" ); - mlt_properties_set( properties, "markup", "" ); - } - } - - return producer; - } - free( this ); - return NULL; -} - -static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable ) -{ - // Obtain properties of frame - mlt_properties properties = mlt_frame_properties( this ); - - // May need to know the size of the image to clone it - int size = 0; - - // Get the image - uint8_t *image = mlt_properties_get_data( properties, "image", &size ); - - // Get width and height - *width = mlt_properties_get_int( properties, "width" ); - *height = mlt_properties_get_int( properties, "height" ); - - // Clone if necessary - if ( writable ) - { - // Clone our image - uint8_t *copy = malloc( size ); - memcpy( copy, image, size ); - - // We're going to pass the copy on - image = copy; - - // Now update properties so we free the copy after - mlt_properties_set_data( properties, "image", copy, size, free, NULL ); - } - - // Pass on the image - *buffer = image; - - return 0; -} - -static uint8_t *producer_get_alpha_mask( mlt_frame this ) -{ - // Obtain properties of frame - mlt_properties properties = mlt_frame_properties( this ); - - // Return the alpha mask - return mlt_properties_get_data( properties, "alpha", NULL ); -} - -static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index ) -{ - producer_pango this = producer->child; - GdkPixbuf *pixbuf = NULL; - - // Generate a frame - *frame = mlt_frame_init( ); - - // Obtain properties of frame and producer - mlt_properties properties = mlt_frame_properties( *frame ); - mlt_properties producer_props = mlt_producer_properties( producer ); - - // Get producer properties - int fg = mlt_properties_get_int( producer_props, "fgcolor" ); - int bg = mlt_properties_get_int( producer_props, "bgcolor" ); - int align = mlt_properties_get_int( producer_props, "align" ); - int pad = mlt_properties_get_int( producer_props, "pad" ); - char *markup = mlt_properties_get( producer_props, "markup" ); - char *text = mlt_properties_get( producer_props, "text" ); - char *font = mlt_properties_get( producer_props, "font" ); - - // See if any properties changed - int property_changed = ( fg != this->fgcolor ); - property_changed = property_changed || ( bg != this->bgcolor ); - property_changed = property_changed || ( align != this->align ); - property_changed = property_changed || ( pad != this->pad ); - property_changed = property_changed || ( markup && this->markup && strcmp( markup, this->markup ) ); - property_changed = property_changed || ( text && this->text && strcmp( text, this->text ) ); - property_changed = property_changed || ( font && this->font && strcmp( font, this->font ) ); - - // Save the properties for next comparison - this->fgcolor = fg; - this->bgcolor = bg; - this->align = align; - this->pad = pad; - if ( markup != NULL ) - { - if ( this->markup != NULL ) - free( this->markup ); - this->markup = strdup( markup ); - } - if ( text != NULL ) - { - if ( this->text != NULL ) - free( this->text ); - this->text = strdup( text ); - } - if ( font != NULL ) - { - if ( this->font != NULL ) - free( this->font ); - this->font = strdup( font ); - } - - if ( property_changed ) - { - rgba_color fgcolor = - { - ( fg & 0xff000000 ) >> 24, - ( fg & 0x00ff0000 ) >> 16, - ( fg & 0x0000ff00 ) >> 8, - ( fg & 0x000000ff ) - }; - rgba_color bgcolor = - { - ( bg & 0xff000000 ) >> 24, - ( bg & 0x00ff0000 ) >> 16, - ( bg & 0x0000ff00 ) >> 8, - ( bg & 0x000000ff ) - }; - - // Render the title - pixbuf = pango_get_pixbuf( markup, text, font, fgcolor, bgcolor, pad, align ); - } - - // If we have a pixbuf - if ( pixbuf ) - { - // Scale to adjust for sample aspect ratio - if ( mlt_properties_get_int( properties, "video_standard" ) == mlt_video_standard_pal ) - { - GdkPixbuf *temp = pixbuf; - GdkPixbuf *scaled = gdk_pixbuf_scale_simple( pixbuf, - (gint) ( (float) gdk_pixbuf_get_width( pixbuf ) * 54.0/59.0), - gdk_pixbuf_get_height( pixbuf ), GDK_INTERP_HYPER ); - pixbuf = scaled; - g_object_unref( temp ); - } - else - { - GdkPixbuf *temp = pixbuf; - GdkPixbuf *scaled = gdk_pixbuf_scale_simple( pixbuf, - (gint) ( (float) gdk_pixbuf_get_width( pixbuf ) * 11.0/10.0 ), - gdk_pixbuf_get_height( pixbuf ), GDK_INTERP_HYPER ); - pixbuf = scaled; - g_object_unref( temp ); - } - - // Store width and height - this->width = gdk_pixbuf_get_width( pixbuf ); - this->height = gdk_pixbuf_get_height( pixbuf ); - - // Allocate/define image and alpha - uint8_t *image = malloc( this->width * this->height * 2 ); - uint8_t *alpha = NULL; - - // Extract YUV422 and alpha - if ( gdk_pixbuf_get_has_alpha( pixbuf ) ) - { - // Allocate the alpha mask - alpha = malloc( this->width * this->height ); - - // Convert the image - mlt_convert_rgb24a_to_yuv422( gdk_pixbuf_get_pixels( pixbuf ), - this->width, this->height, - gdk_pixbuf_get_rowstride( pixbuf ), - image, alpha ); - } - else - { - // No alpha to extract - mlt_convert_rgb24_to_yuv422( gdk_pixbuf_get_pixels( pixbuf ), - this->width, this->height, - gdk_pixbuf_get_rowstride( pixbuf ), - image ); - } - - // Finished with pixbuf now - g_object_unref( pixbuf ); - - // if single picture, reference the image and alpha in the producer - if ( this->image != NULL ) - free( this->image ); - this->image = image; - if ( this->alpha != NULL ) - free( this->alpha ); - this->alpha = alpha; - - } - - if ( this->image != NULL ) - { - // Set width/height - mlt_properties_set_int( properties, "width", this->width ); - mlt_properties_set_int( properties, "height", this->height ); - - // Set the compositing properties - if ( mlt_properties_get( producer_props, "x" ) != NULL ) - mlt_properties_set_int( properties, "x", mlt_properties_get_int( producer_props, "x" ) ); - if ( mlt_properties_get( producer_props, "y" ) != NULL ) - mlt_properties_set_int( properties, "y", mlt_properties_get_int( producer_props, "y" ) ); - if ( mlt_properties_get( producer_props, "mix" ) != NULL ) - mlt_properties_set_double( properties, "image.mix", mlt_properties_get_double( producer_props, "mix" ) ); - - // if picture sequence pass the image and alpha data without destructor - mlt_properties_set_data( properties, "image", this->image, this->width * this->height * 2, NULL, NULL ); - mlt_properties_set_data( properties, "alpha", this->alpha, this->width * this->height, NULL, NULL ); - - // Set alpha mask call back - ( *frame )->get_alpha_mask = producer_get_alpha_mask; - - // Stack the get image callback - mlt_frame_push_get_image( *frame, producer_get_image ); - } - - // Update timecode on the frame we're creating - mlt_frame_set_position( *frame, mlt_producer_position( producer ) ); - - // Calculate the next timecode - mlt_producer_prepare_next( producer ); - - return 0; -} - -static void producer_close( mlt_producer parent ) -{ - producer_pango this = parent->child; - if ( this->image != NULL ) - free( this->image ); - if ( this->alpha != NULL ) - free( this->alpha ); - if ( this->markup != NULL ) - free( this->markup ); - if ( this->text != NULL ) - free( this->text ); - if ( this->font != NULL ) - free( this->font ); - parent->close = NULL; - mlt_producer_close( parent ); - free( this ); -} - -static void pango_draw_background( GdkPixbuf *pixbuf, rgba_color bg ) -{ - int ww = gdk_pixbuf_get_width( pixbuf ); - int hh = gdk_pixbuf_get_height( pixbuf ); - uint8_t *p = gdk_pixbuf_get_pixels( pixbuf ); - int i, j; - - for ( j = 0; j < hh; j++ ) - { - for ( i = 0; i < ww; i++ ) - { - *p++ = bg.r; - *p++ = bg.g; - *p++ = bg.b; - *p++ = bg.a; - } - } -} - -static GdkPixbuf *pango_get_pixbuf( const char *markup, const char *text, const char *font, rgba_color fg, rgba_color bg, int pad, int align ) -{ - PangoFT2FontMap *fontmap = (PangoFT2FontMap*) pango_ft2_font_map_new(); - PangoContext *context = pango_ft2_font_map_create_context( fontmap ); - PangoLayout *layout = pango_layout_new( context ); - int w, h, x; - int i, j; - GdkPixbuf *pixbuf = NULL; - FT_Bitmap bitmap; - uint8_t *src = NULL; - uint8_t* dest = NULL; - int stride; - - pango_ft2_font_map_set_resolution( fontmap, 72, 72 ); - pango_layout_set_width( layout, -1 ); // set wrapping constraints - pango_layout_set_font_description( layout, pango_font_description_from_string( font ) ); -// pango_layout_set_spacing( layout, space ); - pango_layout_set_alignment( layout, ( PangoAlignment ) align ); - if ( markup != NULL && strcmp( markup, "" ) != 0 ) - pango_layout_set_markup( layout, markup, strlen( markup ) ); - else if ( text != NULL && strcmp( text, "" ) != 0 ) - pango_layout_set_text( layout, text, strlen( text ) ); - else - return NULL; - pango_layout_get_pixel_size( layout, &w, &h ); - - pixbuf = gdk_pixbuf_new( GDK_COLORSPACE_RGB, TRUE /* has alpha */, 8, w + 2 * pad, h + 2 * pad ); - pango_draw_background( pixbuf, bg ); - - stride = gdk_pixbuf_get_rowstride( pixbuf ); - - bitmap.width = w; - bitmap.pitch = 32 * ( ( w + 31 ) / 31 ); - bitmap.rows = h; - bitmap.buffer = ( unsigned char * ) calloc( 1, h * bitmap.pitch ); - bitmap.num_grays = 256; - bitmap.pixel_mode = ft_pixel_mode_grays; - - pango_ft2_render_layout( &bitmap, layout, 0, 0 ); - - src = bitmap.buffer; - x = ( gdk_pixbuf_get_width( pixbuf ) - w - 2 * pad ) * align / 2 + pad; - dest = gdk_pixbuf_get_pixels( pixbuf ) + 4 * x + pad * stride; - for ( j = 0; j < h; j++ ) - { - uint8_t *d = dest; - for ( i = 0; i < w; i++ ) - { - float a = ( float ) bitmap.buffer[ j * bitmap.pitch + i ] / 255.0; - *d++ = ( int ) ( a * fg.r + ( 1 - a ) * bg.r ); - *d++ = ( int ) ( a * fg.g + ( 1 - a ) * bg.g ); - *d++ = ( int ) ( a * fg.b + ( 1 - a ) * bg.b ); - *d++ = ( int ) ( a * fg.a + ( 1 - a ) * bg.a ); - } - dest += stride; - } - free( bitmap.buffer ); - - g_object_unref( layout ); - g_object_unref( context ); - g_object_unref( fontmap ); - - return pixbuf; -} - diff --git a/mlt/src/modules/gtk2/producer_pango.h b/mlt/src/modules/gtk2/producer_pango.h deleted file mode 100644 index fbed05c..0000000 --- a/mlt/src/modules/gtk2/producer_pango.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * producer_pango.h -- a pango-based titler - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _PRODUCER_PANGO_H_ -#define _PRODUCER_PANGO_H_ - -#include - -typedef struct producer_pango_s *producer_pango; - -typedef enum -{ - pango_align_left = 0, - pango_align_center, - pango_align_right -} pango_align; - -extern mlt_producer producer_pango_init( const char *filename ); - -#endif diff --git a/mlt/src/modules/gtk2/producer_pixbuf.c b/mlt/src/modules/gtk2/producer_pixbuf.c deleted file mode 100644 index 8a1d3a3..0000000 --- a/mlt/src/modules/gtk2/producer_pixbuf.c +++ /dev/null @@ -1,346 +0,0 @@ -/* - * producer_pixbuf.c -- raster image loader based upon gdk-pixbuf - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#include "producer_pixbuf.h" -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index ); -static void producer_close( mlt_producer parent ); - -typedef enum -{ - SIGNAL_FORMAT_PAL, - SIGNAL_FORMAT_NTSC -} mlt_signal_format; - -static int filter_files( const struct dirent *de ) -{ - if ( de->d_name[ 0 ] != '.' ) - return 1; - else - return 0; -} - - -mlt_producer producer_pixbuf_init( char *filename ) -{ - producer_pixbuf this = calloc( sizeof( struct producer_pixbuf_s ), 1 ); - if ( filename != NULL && this != NULL && mlt_producer_init( &this->parent, this ) == 0 ) - { - mlt_producer producer = &this->parent; - - producer->get_frame = producer_get_frame; - producer->close = producer_close; - - // Get the properties interface - mlt_properties properties = mlt_producer_properties( &this->parent ); - - // Set the default properties - mlt_properties_set( properties, "resource", filename ); - mlt_properties_set_int( properties, "video_standard", mlt_video_standard_pal ); - mlt_properties_set_double( properties, "ttl", 5 ); - - // Obtain filenames - if ( strchr( filename, '%' ) != NULL ) - { - // handle picture sequences - int i = 0; - int gap = 0; - char full[1024]; - - while ( gap < 100 ) - { - struct stat buf; - snprintf( full, 1023, filename, i ++ ); - if ( stat( full, &buf ) == 0 ) - { - this->filenames = realloc( this->filenames, sizeof( char * ) * ( this->count + 1 ) ); - this->filenames[ this->count ++ ] = strdup( full ); - gap = 0; - } - else - { - gap ++; - } - } - mlt_properties_set_position( properties, "out", this->count * 25 ); - } - else if ( strstr( filename, "/.all." ) != NULL ) - { - char *dir_name = strdup( filename ); - char *extension = strrchr( filename, '.' ); - *( strstr( dir_name, "/.all." ) + 1 ) = '\0'; - char fullname[ 1024 ]; - strcpy( fullname, dir_name ); - struct dirent **de = NULL; - int n = scandir( fullname, &de, filter_files, alphasort ); - int i; - struct stat info; - - for (i = 0; i < n; i++ ) - { - snprintf( fullname, 1023, "%s%s", dir_name, de[i]->d_name ); - - if ( lstat( fullname, &info ) == 0 && - ( S_ISREG( info.st_mode ) || ( strstr( fullname, extension ) && info.st_mode | S_IXUSR ) ) ) - { - this->filenames = realloc( this->filenames, sizeof( char * ) * ( this->count + 1 ) ); - this->filenames[ this->count ++ ] = strdup( fullname ); - } - free( de[ i ] ); - } - - mlt_properties_set_position( properties, "out", this->count * 25 ); - free( de ); - free( dir_name ); - } - else - { - this->filenames = realloc( this->filenames, sizeof( char * ) * ( this->count + 1 ) ); - this->filenames[ this->count ++ ] = strdup( filename ); - mlt_properties_set_position( properties, "out", 25 ); - } - - // Initialise gobject types - g_type_init(); - - return producer; - } - free( this ); - return NULL; -} - -static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable ) -{ - // Obtain properties of frame - mlt_properties properties = mlt_frame_properties( this ); - - // May need to know the size of the image to clone it - int size = 0; - - // Get the image - uint8_t *image = mlt_properties_get_data( properties, "image", &size ); - - // Get width and height - *width = mlt_properties_get_int( properties, "width" ); - *height = mlt_properties_get_int( properties, "height" ); - - // Clone if necessary - // NB: Cloning is necessary with this producer (due to processing of images ahead of use) - // The fault is not in the design of mlt, but in the implementation of pixbuf... - //if ( writable ) - { - size = *width * *height * 2; - - // Clone our image - uint8_t *copy = malloc( size ); - memcpy( copy, image, size ); - - // We're going to pass the copy on - image = copy; - - // Now update properties so we free the copy after - mlt_properties_set_data( properties, "image", copy, size, free, NULL ); - } - - // Pass on the image - *buffer = image; - - return 0; -} - -static uint8_t *producer_get_alpha_mask( mlt_frame this ) -{ - // Obtain properties of frame - mlt_properties properties = mlt_frame_properties( this ); - - // Return the alpha mask - return mlt_properties_get_data( properties, "alpha", NULL ); -} - -static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index ) -{ - producer_pixbuf this = producer->child; - GdkPixbuf *pixbuf = NULL; - GError *error = NULL; - - // Generate a frame - *frame = mlt_frame_init( ); - - // Obtain properties of frame - mlt_properties properties = mlt_frame_properties( *frame ); - - // Obtain properties of producer - mlt_properties producer_props = mlt_producer_properties( producer ); - - // Get the time to live for each frame - double ttl = mlt_properties_get_double( producer_props, "ttl" ); - - // Image index - int image_idx = ( int )floor( mlt_producer_position( producer ) / ttl ) % this->count; - - // Update timecode on the frame we're creating - mlt_frame_set_position( *frame, mlt_producer_position( producer ) ); - - // optimization for subsequent iterations on single picture - if ( this->image != NULL && image_idx == this->image_idx ) - { - // Set width/height - mlt_properties_set_int( properties, "width", this->width ); - mlt_properties_set_int( properties, "height", this->height ); - - // Set the compositing properties - if ( mlt_properties_get( producer_props, "x" ) != NULL ) - mlt_properties_set_int( properties, "x", mlt_properties_get_int( producer_props, "x" ) ); - if ( mlt_properties_get( producer_props, "y" ) != NULL ) - mlt_properties_set_int( properties, "y", mlt_properties_get_int( producer_props, "y" ) ); - if ( mlt_properties_get( producer_props, "mix" ) != NULL ) - mlt_properties_set_double( properties, "image.mix", mlt_properties_get_double( producer_props, "mix" ) ); - - // if picture sequence pass the image and alpha data without destructor - mlt_properties_set_data( properties, "image", this->image, 0, NULL, NULL ); - mlt_properties_set_data( properties, "alpha", this->alpha, 0, NULL, NULL ); - - // Set alpha mask call back - ( *frame )->get_alpha_mask = producer_get_alpha_mask; - - // Stack the get image callback - mlt_frame_push_get_image( *frame, producer_get_image ); - } - else - { - free( this->image ); - free( this->alpha ); - this->image_idx = image_idx; - pixbuf = gdk_pixbuf_new_from_file( this->filenames[ image_idx ], &error ); - } - - // If we have a pixbuf - if ( pixbuf ) - { - // Scale to adjust for sample aspect ratio - if ( mlt_properties_get_int( properties, "video_standard" ) == mlt_video_standard_pal ) - { - GdkPixbuf *temp = pixbuf; - GdkPixbuf *scaled = gdk_pixbuf_scale_simple( pixbuf, - (gint) ( (float) gdk_pixbuf_get_width( pixbuf ) * 54.0/59.0), - gdk_pixbuf_get_height( pixbuf ), GDK_INTERP_HYPER ); - pixbuf = scaled; - g_object_unref( temp ); - } - else - { - GdkPixbuf *temp = pixbuf; - GdkPixbuf *scaled = gdk_pixbuf_scale_simple( pixbuf, - (gint) ( (float) gdk_pixbuf_get_width( pixbuf ) * 11.0/10.0 ), - gdk_pixbuf_get_height( pixbuf ), GDK_INTERP_HYPER ); - pixbuf = scaled; - g_object_unref( temp ); - } - - // Store width and height - this->width = gdk_pixbuf_get_width( pixbuf ); - this->height = gdk_pixbuf_get_height( pixbuf ); - this->width -= this->width % 4; - this->height -= this->height % 2; - - // Allocate/define image and alpha - uint8_t *image = malloc( this->width * this->height * 2 ); - uint8_t *alpha = NULL; - - // Extract YUV422 and alpha - if ( gdk_pixbuf_get_has_alpha( pixbuf ) ) - { - // Allocate the alpha mask - alpha = malloc( this->width * this->height ); - - // Convert the image - mlt_convert_rgb24a_to_yuv422( gdk_pixbuf_get_pixels( pixbuf ), - this->width, this->height, - gdk_pixbuf_get_rowstride( pixbuf ), - image, alpha ); - } - else - { - // No alpha to extract - mlt_convert_rgb24_to_yuv422( gdk_pixbuf_get_pixels( pixbuf ), - this->width, this->height, - gdk_pixbuf_get_rowstride( pixbuf ), - image ); - } - - // Finished with pixbuf now - g_object_unref( pixbuf ); - - // Set width/height of frame - mlt_properties_set_int( properties, "width", this->width ); - mlt_properties_set_int( properties, "height", this->height ); - - // Set the compositing properties - if ( mlt_properties_get( producer_props, "x" ) != NULL ) - mlt_properties_set_int( properties, "x", mlt_properties_get_int( producer_props, "x" ) ); - if ( mlt_properties_get( producer_props, "y" ) != NULL ) - mlt_properties_set_int( properties, "y", mlt_properties_get_int( producer_props, "y" ) ); - if ( mlt_properties_get( producer_props, "mix" ) != NULL ) - mlt_properties_set_double( properties, "mix", mlt_properties_get_double( producer_props, "mix" ) ); - - // Pass alpha and image on properties with or without destructor - this->image = image; - this->alpha = alpha; - - // pass the image and alpha data without destructor - mlt_properties_set_data( properties, "image", image, this->width * this->height * 2, NULL, NULL ); - mlt_properties_set_data( properties, "alpha", alpha, this->width * this->height, NULL, NULL ); - - // Set alpha call back - ( *frame )->get_alpha_mask = producer_get_alpha_mask; - - // Push the get_image method - mlt_frame_push_get_image( *frame, producer_get_image ); - } - - // Calculate the next timecode - mlt_producer_prepare_next( producer ); - - return 0; -} - -static void producer_close( mlt_producer parent ) -{ - producer_pixbuf this = parent->child; - if ( this->image ) - free( this->image ); - if ( this->alpha ) - free( this->alpha ); - parent->close = NULL; - mlt_producer_close( parent ); - free( this ); -} - diff --git a/mlt/src/modules/gtk2/producer_pixbuf.h b/mlt/src/modules/gtk2/producer_pixbuf.h deleted file mode 100644 index 74b8f7a..0000000 --- a/mlt/src/modules/gtk2/producer_pixbuf.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * producer_pixbuf.h -- raster image loader based upon gdk-pixbuf - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _PRODUCER_PIXBUF_H_ -#define _PRODUCER_PIXBUF_H_ - -#include - -typedef struct producer_pixbuf_s *producer_pixbuf; - -struct producer_pixbuf_s -{ - struct mlt_producer_s parent; - - // File name list - char **filenames; - int count; - int image_idx; - - int width; - int height; - uint8_t *image; - uint8_t *alpha; -}; - -extern mlt_producer producer_pixbuf_init( char *filename ); - -#endif diff --git a/mlt/src/modules/inigo/Makefile b/mlt/src/modules/inigo/Makefile deleted file mode 100644 index c52ae1d..0000000 --- a/mlt/src/modules/inigo/Makefile +++ /dev/null @@ -1,27 +0,0 @@ - -TARGET = ../libinigo.so - -OBJS = factory.o \ - producer_inigo.o - -CFLAGS = -I../../ -Wall -g -D_FILE_OFFSET_BITS=64 -pthread - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) -shared -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/modules/inigo/configure b/mlt/src/modules/inigo/configure deleted file mode 100755 index 617ee0a..0000000 --- a/mlt/src/modules/inigo/configure +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -if [ "$help" != "1" ] -then - -cat << EOF >> ../producers.dat -inigo libinigo.so -EOF - -fi - diff --git a/mlt/src/modules/inigo/factory.c b/mlt/src/modules/inigo/factory.c deleted file mode 100644 index 29320a8..0000000 --- a/mlt/src/modules/inigo/factory.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * factory.c -- the factory method interfaces - * 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 program 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. - * - * 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. - */ - -#include - -#include "producer_inigo.h" - -void *mlt_create_producer( char *id, void *arg ) -{ - if ( !strcmp( id, "inigo" ) ) - return producer_inigo_init( arg ); - return NULL; -} - -void *mlt_create_filter( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_transition( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_consumer( char *id, void *arg ) -{ - return NULL; -} - diff --git a/mlt/src/modules/inigo/producer_inigo.c b/mlt/src/modules/inigo/producer_inigo.c deleted file mode 100644 index 3150ae6..0000000 --- a/mlt/src/modules/inigo/producer_inigo.c +++ /dev/null @@ -1,250 +0,0 @@ -/* - * producer_inigo.c -- simple inigo test case - * 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 program 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. - * - * 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. - */ - -#include "producer_inigo.h" - -#include -#include -#include - -#include - -static mlt_producer parse_inigo( char *file ) -{ - FILE *input = fopen( file, "r" ); - char **args = calloc( sizeof( char * ), 1000 ); - int count = 0; - char temp[ 2048 ]; - - if ( input != NULL ) - { - while( fgets( temp, 2048, input ) ) - { - temp[ strlen( temp ) - 1 ] = '\0'; - if ( strcmp( temp, "" ) ) - args[ count ++ ] = strdup( temp ); - } - } - - mlt_producer result = producer_inigo_init( args ); - - if ( result != NULL ) - { - mlt_properties properties = mlt_producer_properties( result ); - mlt_properties_set( properties, "resource", file ); - } - - while( count -- ) - free( args[ count ] ); - free( args ); - - return result; -} - -static mlt_producer create_producer( char *file ) -{ - mlt_producer result = NULL; - - // 1st Line preferences - if ( strstr( file, ".inigo" ) ) - result = parse_inigo( file ); - else if ( strstr( file, ".mpg" ) ) - result = mlt_factory_producer( "mcmpeg", file ); - else if ( strstr( file, ".mpeg" ) ) - result = mlt_factory_producer( "mcmpeg", file ); - else if ( strstr( file, ".dv" ) ) - result = mlt_factory_producer( "mcdv", file ); - else if ( strstr( file, ".dif" ) ) - result = mlt_factory_producer( "mcdv", file ); - else if ( strstr( file, ".jpg" ) ) - result = mlt_factory_producer( "pixbuf", file ); - else if ( strstr( file, ".JPG" ) ) - result = mlt_factory_producer( "pixbuf", file ); - else if ( strstr( file, ".jpeg" ) ) - result = mlt_factory_producer( "pixbuf", file ); - else if ( strstr( file, ".png" ) ) - result = mlt_factory_producer( "pixbuf", file ); - else if ( strstr( file, ".txt" ) ) - result = mlt_factory_producer( "pango", file ); - - // 2nd Line fallbacks - if ( result == NULL && strstr( file, ".dv" ) ) - result = mlt_factory_producer( "libdv", file ); - else if ( result == NULL && strstr( file, ".dif" ) ) - result = mlt_factory_producer( "libdv", file ); - - // 3rd line fallbacks - if ( result == NULL ) - result = mlt_factory_producer( "ffmpeg", file ); - - return result; -} - -static void track_service( mlt_field field, void *service, mlt_destructor destructor ) -{ - mlt_properties properties = mlt_field_properties( field ); - int registered = mlt_properties_get_int( properties, "registered" ); - char *key = mlt_properties_get( properties, "registered" ); - mlt_properties_set_data( properties, key, service, 0, destructor, NULL ); - mlt_properties_set_int( properties, "registered", ++ registered ); -} - -static mlt_filter create_filter( mlt_field field, char *id, int track ) -{ - char *arg = strchr( id, ':' ); - if ( arg != NULL ) - *arg ++ = '\0'; - mlt_filter filter = mlt_factory_filter( id, arg ); - if ( filter != NULL ) - { - mlt_field_plant_filter( field, filter, track ); - track_service( field, filter, ( mlt_destructor )mlt_filter_close ); - } - return filter; -} - -static mlt_transition create_transition( mlt_field field, char *id, int track ) -{ - char *arg = strchr( id, ':' ); - if ( arg != NULL ) - *arg ++ = '\0'; - mlt_transition transition = mlt_factory_transition( id, arg ); - if ( transition != NULL ) - { - mlt_field_plant_transition( field, transition, track, track + 1 ); - track_service( field, transition, ( mlt_destructor )mlt_transition_close ); - } - return transition; -} - -mlt_producer producer_inigo_init( char **argv ) -{ - int i; - int track = 0; - mlt_producer producer = NULL; - mlt_playlist playlist = mlt_playlist_init( ); - mlt_properties group = mlt_properties_new( ); - mlt_properties properties = group; - mlt_field field = mlt_field_init( ); - mlt_properties field_properties = mlt_field_properties( field ); - mlt_multitrack multitrack = mlt_field_multitrack( field ); - - // We need to track the number of registered filters - mlt_properties_set_int( field_properties, "registered", 0 ); - - // Parse the arguments - for ( i = 0; argv[ i ] != NULL; i ++ ) - { - if ( !strcmp( argv[ i ], "-group" ) ) - { - if ( mlt_properties_count( group ) != 0 ) - { - mlt_properties_close( group ); - group = mlt_properties_new( ); - } - if ( group != NULL ) - properties = group; - } - else if ( !strcmp( argv[ i ], "-filter" ) ) - { - mlt_filter filter = create_filter( field, argv[ ++ i ], track ); - if ( filter != NULL ) - { - properties = mlt_filter_properties( filter ); - mlt_properties_inherit( properties, group ); - } - } - else if ( !strcmp( argv[ i ], "-transition" ) ) - { - mlt_transition transition = create_transition( field, argv[ ++ i ], track ); - if ( transition != NULL ) - { - properties = mlt_transition_properties( transition ); - mlt_properties_inherit( properties, group ); - } - } - else if ( !strcmp( argv[ i ], "-blank" ) ) - { - if ( producer != NULL ) - mlt_playlist_append( playlist, producer ); - producer = NULL; - mlt_playlist_blank( playlist, atof( argv[ ++ i ] ) ); - } - else if ( !strcmp( argv[ i ], "-track" ) ) - { - if ( producer != NULL ) - mlt_playlist_append( playlist, producer ); - producer = NULL; - mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist ), track ++ ); - playlist = mlt_playlist_init( ); - } - else if ( strstr( argv[ i ], "=" ) ) - { - mlt_properties_parse( properties, argv[ i ] ); - } - else if ( argv[ i ][ 0 ] != '-' ) - { - if ( producer != NULL ) - mlt_playlist_append( playlist, producer ); - producer = create_producer( argv[ i ] ); - if ( producer != NULL ) - { - properties = mlt_producer_properties( producer ); - mlt_properties_inherit( properties, group ); - } - } - else - { - if ( !strcmp( argv[ i ], "-serialise" ) ) - i += 2; - else if ( !strcmp( argv[ i ], "-consumer" ) ) - i += 2; - - while ( argv[ i ] != NULL && strchr( argv[ i ], '=' ) ) - i ++; - - i --; - } - } - - // Connect producer to playlist - if ( producer != NULL ) - mlt_playlist_append( playlist, producer ); - - // We must have a producer at this point - if ( mlt_playlist_count( playlist ) > 0 ) - { - // Connect multitrack to producer - mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist ), track ); - } - - mlt_tractor tractor = mlt_field_tractor( field ); - mlt_producer prod = mlt_tractor_producer( tractor ); - mlt_properties props = mlt_tractor_properties( tractor ); - mlt_properties_set_data( props, "multitrack", multitrack, 0, NULL, NULL ); - mlt_properties_set_data( props, "field", field, 0, NULL, NULL ); - mlt_properties_set_data( props, "group", group, 0, NULL, NULL ); - mlt_properties_set_position( props, "length", mlt_producer_get_out( mlt_multitrack_producer( multitrack ) ) + 1 ); - mlt_producer_set_in_and_out( prod, 0, mlt_producer_get_out( mlt_multitrack_producer( multitrack ) ) ); - mlt_properties_set_double( props, "fps", mlt_producer_get_fps( mlt_multitrack_producer( multitrack ) ) ); - - return mlt_tractor_producer( tractor ); -} - diff --git a/mlt/src/modules/inigo/producer_inigo.h b/mlt/src/modules/inigo/producer_inigo.h deleted file mode 100644 index be65692..0000000 --- a/mlt/src/modules/inigo/producer_inigo.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_inigo.h -- simple inigo test case - * 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 program 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. - * - * 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. - */ - -#ifndef _PRODUCER_INIGO_H_ -#define _PRODUCER_INIGO_H_ - -#include - -extern mlt_producer producer_inigo_init( char **args ); - -#endif diff --git a/mlt/src/modules/resample/Makefile b/mlt/src/modules/resample/Makefile deleted file mode 100644 index b8b7542..0000000 --- a/mlt/src/modules/resample/Makefile +++ /dev/null @@ -1,29 +0,0 @@ - -TARGET = ../libmltresample.so - -OBJS = factory.o \ - filter_resample.o - -CFLAGS = -I../../ -Wall -g - -LDFLAGS= -lsamplerate - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) -shared -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/modules/resample/configure b/mlt/src/modules/resample/configure deleted file mode 100755 index 7e0f23a..0000000 --- a/mlt/src/modules/resample/configure +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -if [ "$help" != "1" ] -then - -cat << EOF >> ../filters.dat -resample libmltresample.so -EOF - -fi - diff --git a/mlt/src/modules/resample/factory.c b/mlt/src/modules/resample/factory.c deleted file mode 100644 index 42385a7..0000000 --- a/mlt/src/modules/resample/factory.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * factory.c -- the factory method interfaces - * 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 program 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. - * - * 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. - */ - -#include - -#include "filter_resample.h" - -void *mlt_create_producer( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_filter( char *id, void *arg ) -{ - if ( !strcmp( id, "resample" ) ) - return filter_resample_init( arg ); - return NULL; -} - -void *mlt_create_transition( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_consumer( char *id, void *arg ) -{ - return NULL; -} - diff --git a/mlt/src/modules/resample/filter_resample.c b/mlt/src/modules/resample/filter_resample.c deleted file mode 100644 index 402a278..0000000 --- a/mlt/src/modules/resample/filter_resample.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * filter_resample.c -- adjust audio sample frequency - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#include "filter_resample.h" - -#include - -#include -#include -#include -#define __USE_ISOC99 1 -#include - -#define BUFFER_LEN 20480 -#define RESAMPLE_TYPE SRC_SINC_FASTEST - -/** Get the audio. -*/ - -static int resample_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples ) -{ - // Get the properties of the a frame - mlt_properties properties = mlt_frame_properties( frame ); - int output_rate = mlt_properties_get_int( properties, "resample.frequency" ); - SRC_STATE *state = mlt_properties_get_data( properties, "resample.state", NULL ); - SRC_DATA data; - float *input_buffer = mlt_properties_get_data( properties, "resample.input_buffer", NULL ); - float *output_buffer = mlt_properties_get_data( properties, "resample.output_buffer", NULL ); - int i; - - // Restore the original get_audio - frame->get_audio = mlt_properties_get_data( properties, "resample.get_audio", NULL ); - - // Get the producer's audio - mlt_frame_get_audio( frame, buffer, format, frequency, channels, samples ); - - // Convert to floating point - for ( i = 0; i < *samples * *channels; ++i ) - input_buffer[ i ] = ( float )( (*buffer)[ i ] ) / 32768; - - // Resample - data.data_in = input_buffer; - data.data_out = output_buffer; - data.src_ratio = ( float ) output_rate / ( float ) *frequency; - data.input_frames = *samples; - data.output_frames = BUFFER_LEN / *channels; - data.end_of_input = 0; - i = src_process( state, &data ); - if ( i == 0 ) - { - if ( data.output_frames_gen > *samples ) - { - *buffer = (int16_t*) malloc( data.output_frames_gen * *channels * 2 ); - mlt_properties_set_data( properties, "audio", *buffer, *channels * data.output_frames_gen * 2, free, NULL ); - } - *samples = data.output_frames_gen; - *frequency = output_rate; - - // Convert from floating back to signed 16bit - for ( i = 0; i < *samples * *channels; ++i ) - { - float sample = output_buffer[ i ]; - if ( sample > 1.0 ) - sample = 1.0; - if ( sample < -1.0 ) - sample = -1.0; - if ( sample >= 0 ) - (*buffer)[ i ] = lrint( 32767.0 * sample ); - else - (*buffer)[ i ] = lrint( 32768.0 * sample ); - } - } - else - fprintf( stderr, "resample_get_audio: %s\n", src_strerror( i ) ); - - return 0; -} - -/** Filter processing. -*/ - -static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) -{ - mlt_properties properties = mlt_filter_properties( this ); - mlt_properties frame_props = mlt_frame_properties( frame ); - - // Propogate the frequency property if supplied - if ( mlt_properties_get( properties, "frequency" ) != NULL ) - mlt_properties_set_int( frame_props, "resample.frequency", mlt_properties_get_int( properties, "frequency" ) ); - - // Propogate the other properties - mlt_properties_set_int( frame_props, "resample.channels", mlt_properties_get_int( properties, "channels" ) ); - mlt_properties_set_data( frame_props, "resample.state", mlt_properties_get_data( properties, "state", NULL ), 0, NULL, NULL ); - mlt_properties_set_data( frame_props, "resample.input_buffer", mlt_properties_get_data( properties, "input_buffer", NULL ), 0, NULL, NULL ); - mlt_properties_set_data( frame_props, "resample.output_buffer", mlt_properties_get_data( properties, "output_buffer", NULL ), 0, NULL, NULL ); - - // Backup the original get_audio (it's still needed) - mlt_properties_set_data( frame_props, "resample.get_audio", frame->get_audio, 0, NULL, NULL ); - - // Override the get_audio method - frame->get_audio = resample_get_audio; - - return frame; -} - -/** Constructor for the filter. -*/ - -mlt_filter filter_resample_init( char *arg ) -{ - mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 ); - if ( this != NULL && mlt_filter_init( this, NULL ) == 0 ) - { - int error; - SRC_STATE *state = src_new( RESAMPLE_TYPE, 2 /* channels */, &error ); - if ( error == 0 ) - { - this->process = filter_process; - if ( arg != NULL ) - mlt_properties_set_int( mlt_filter_properties( this ), "frequency", atoi( arg ) ); - mlt_properties_set_int( mlt_filter_properties( this ), "channels", 2 ); - mlt_properties_set_data( mlt_filter_properties( this ), "state", state, 0, (mlt_destructor)src_delete, NULL ); - mlt_properties_set_data( mlt_filter_properties( this ), "input_buffer", - malloc( BUFFER_LEN ), BUFFER_LEN, free, NULL ); - mlt_properties_set_data( mlt_filter_properties( this ), "output_buffer", - malloc( BUFFER_LEN ), BUFFER_LEN, free, NULL ); - } - else - { - fprintf( stderr, "filter_resample_init: %s\n", src_strerror( error ) ); - } - } - return this; -} - diff --git a/mlt/src/modules/resample/filter_resample.h b/mlt/src/modules/resample/filter_resample.h deleted file mode 100644 index 6ce7eb4..0000000 --- a/mlt/src/modules/resample/filter_resample.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_resample.h -- adjust audio sample frequency - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _FILTER_RESAMPLE_H_ -#define _FILTER_RESAMPLE_H_ - -#include - -extern mlt_filter filter_resample_init( char *arg ); - -#endif diff --git a/mlt/src/modules/sdl/Makefile b/mlt/src/modules/sdl/Makefile deleted file mode 100644 index b527594..0000000 --- a/mlt/src/modules/sdl/Makefile +++ /dev/null @@ -1,29 +0,0 @@ - -TARGET = ../libmltsdl.so - -OBJS = factory.o \ - consumer_sdl.o - -CFLAGS = -I../../ `sdl-config --cflags` -Wall -g -D_FILE_OFFSET_BITS=64 -pthread - -LDFLAGS= `sdl-config --libs` - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) -shared -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/modules/sdl/configure b/mlt/src/modules/sdl/configure deleted file mode 100755 index 1c40fac..0000000 --- a/mlt/src/modules/sdl/configure +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -if [ "$help" != "1" ] -then - -cat << EOF >> ../consumers.dat -sdl libmltsdl.so -EOF - -fi - diff --git a/mlt/src/modules/sdl/consumer_sdl.c b/mlt/src/modules/sdl/consumer_sdl.c deleted file mode 100644 index dbd4ff3..0000000 --- a/mlt/src/modules/sdl/consumer_sdl.c +++ /dev/null @@ -1,584 +0,0 @@ -/* - * consumer_sdl.c -- A Simple DirectMedia Layer consumer - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#include "consumer_sdl.h" -#include -#include -#include -#include -#include -#include -#include - -/** This classes definition. -*/ - -typedef struct consumer_sdl_s *consumer_sdl; - -struct consumer_sdl_s -{ - struct mlt_consumer_s parent; - mlt_properties properties; - int format; - int video; - pthread_t thread; - int running; - uint8_t audio_buffer[ 4096 * 3 ]; - int audio_avail; - pthread_mutex_t audio_mutex; - pthread_cond_t audio_cond; - int window_width; - int window_height; - float aspect_ratio; - int width; - int height; - int playing; - mlt_frame *queue; - int size; - int count; - int sdl_flags; - SDL_Surface *sdl_screen; - SDL_Overlay *sdl_overlay; - uint8_t *buffer; -}; - -/** Forward references to static functions. -*/ - -static int consumer_start( mlt_consumer parent ); -static int consumer_stop( mlt_consumer parent ); -static int consumer_is_stopped( mlt_consumer parent ); -static void consumer_close( mlt_consumer parent ); -static void *consumer_thread( void * ); -static int consumer_get_dimensions( int *width, int *height ); - -/** This is what will be called by the factory - anything can be passed in - via the argument, but keep it simple. -*/ - -mlt_consumer consumer_sdl_init( char *arg ) -{ - // Create the consumer object - consumer_sdl this = calloc( sizeof( struct consumer_sdl_s ), 1 ); - - // If no malloc'd and consumer init ok - if ( this != NULL && mlt_consumer_init( &this->parent, this ) == 0 ) - { - // Get the parent consumer object - mlt_consumer parent = &this->parent; - - // We have stuff to clean up, so override the close method - parent->close = consumer_close; - - // get a handle on properties - mlt_service service = mlt_consumer_service( parent ); - this->properties = mlt_service_properties( service ); - - // Set the default volume - mlt_properties_set_double( this->properties, "volume", 1.0 ); - - // This is the initialisation of the consumer - pthread_mutex_init( &this->audio_mutex, NULL ); - pthread_cond_init( &this->audio_cond, NULL); - - // Default fps - mlt_properties_set_double( this->properties, "fps", 25 ); - - // process actual param - if ( arg == NULL || !strcmp( arg, "PAL" ) ) - { - this->width = 720; - this->height = 576; - } - else if ( !strcmp( arg, "NTSC" ) ) - { - this->width = 720; - this->height = 480; - mlt_properties_set_double( this->properties, "fps", 29.97 ); - } - else if ( sscanf( arg, "%dx%d", &this->width, &this->height ) != 2 ) - { - this->width = 720; - this->height = 576; - } - - // Default window size and aspect ratio - this->aspect_ratio = 4.0 / 3.0; - this->window_width = (int)( (float)this->height * this->aspect_ratio ) + 1; - this->window_height = this->height; - - // Set the sdl flags - this->sdl_flags = SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWACCEL | SDL_RESIZABLE; - - // Allow thread to be started/stopped - parent->start = consumer_start; - parent->stop = consumer_stop; - parent->is_stopped = consumer_is_stopped; - - // Return the consumer produced - return parent; - } - - // malloc or consumer init failed - free( this ); - - // Indicate failure - return NULL; -} - -int consumer_start( mlt_consumer parent ) -{ - consumer_sdl this = parent->child; - - if ( !this->running ) - { - this->running = 1; - pthread_create( &this->thread, NULL, consumer_thread, this ); - } - - return 0; -} - -int consumer_stop( mlt_consumer parent ) -{ - // Get the actual object - consumer_sdl this = parent->child; - - if ( this->running ) - { - // Kill the thread and clean up - this->running = 0; - - pthread_mutex_lock( &this->audio_mutex ); - pthread_cond_broadcast( &this->audio_cond ); - pthread_mutex_unlock( &this->audio_mutex ); - - pthread_join( this->thread, NULL ); - } - - return 0; -} - -int consumer_is_stopped( mlt_consumer parent ) -{ - consumer_sdl this = parent->child; - return !this->running; -} - -static int sdl_lock_display( ) -{ - SDL_Surface *screen = SDL_GetVideoSurface( ); - return screen != NULL && ( !SDL_MUSTLOCK( screen ) || SDL_LockSurface( screen ) >= 0 ); -} - -static void sdl_unlock_display( ) -{ - SDL_Surface *screen = SDL_GetVideoSurface( ); - if ( screen != NULL && SDL_MUSTLOCK( screen ) ) - SDL_UnlockSurface( screen ); -} - -static void sdl_fill_audio( void *udata, uint8_t *stream, int len ) -{ - consumer_sdl this = udata; - - // Get the volume - float volume = mlt_properties_get_double( this->properties, "volume" ); - - pthread_mutex_lock( &this->audio_mutex ); - - // Block until audio received - while ( this->running && len > this->audio_avail ) - pthread_cond_wait( &this->audio_cond, &this->audio_mutex ); - - if ( this->audio_avail >= len ) - { - // Place in the audio buffer - SDL_MixAudio( stream, this->audio_buffer, len, ( int )( ( float )SDL_MIX_MAXVOLUME * volume ) ); - - // Remove len from the audio available - this->audio_avail -= len; - - // Remove the samples - memmove( this->audio_buffer, this->audio_buffer + len, this->audio_avail ); - } - else - { - // Just to be safe, wipe the stream first - memset( stream, 0, len ); - - // Copy what we have into the stream - memcpy( stream, this->audio_buffer, this->audio_avail ); - - // Mix the audio - SDL_MixAudio( stream, stream, len, ( int )( ( float )SDL_MIX_MAXVOLUME * volume ) ); - - // No audio left - this->audio_avail = 0; - } - - // We're definitely playing now - this->playing = 1; - - pthread_cond_broadcast( &this->audio_cond ); - pthread_mutex_unlock( &this->audio_mutex ); -} - -static int consumer_play_audio( consumer_sdl this, mlt_frame frame, int init_audio ) -{ - // Get the properties of this consumer - mlt_properties properties = this->properties; - mlt_audio_format afmt = mlt_audio_pcm; - - // Set the preferred params of the test card signal - int channels = 2; - int frequency = 48000; - static int counter = 0; - int samples = mlt_sample_calculator( mlt_properties_get_double( this->properties, "fps" ), frequency, counter++ ); - - int16_t *pcm; - int bytes; - - mlt_frame_get_audio( frame, &pcm, &afmt, &frequency, &channels, &samples ); - - if ( mlt_properties_get_int( properties, "audio_off" ) ) - { - this->playing = 1; - return init_audio; - } - - if ( init_audio == 1 ) - { - SDL_AudioSpec request; - SDL_AudioSpec got; - - SDL_EnableKeyRepeat( SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL ); - SDL_EnableUNICODE( 1 ); - - // specify audio format - memset( &request, 0, sizeof( SDL_AudioSpec ) ); - this->playing = 0; - request.freq = frequency; - request.format = AUDIO_S16; - request.channels = channels; - request.samples = 1024; - request.callback = sdl_fill_audio; - request.userdata = (void *)this; - if ( SDL_OpenAudio( &request, &got ) != 0 ) - { - fprintf( stderr, "SDL failed to open audio: %s\n", SDL_GetError() ); - init_audio = 2; - } - else if ( got.size != 0 ) - { - SDL_PauseAudio( 0 ); - init_audio = 0; - } - } - - if ( init_audio == 0 ) - { - bytes = ( samples * channels * 2 ); - pthread_mutex_lock( &this->audio_mutex ); - while ( bytes > ( sizeof( this->audio_buffer) - this->audio_avail ) ) - pthread_cond_wait( &this->audio_cond, &this->audio_mutex ); - mlt_properties properties = mlt_frame_properties( frame ); - if ( mlt_properties_get_double( properties, "speed" ) == 1 ) - memcpy( &this->audio_buffer[ this->audio_avail ], pcm, bytes ); - else - memset( &this->audio_buffer[ this->audio_avail ], 0, bytes ); - this->audio_avail += bytes; - pthread_cond_broadcast( &this->audio_cond ); - pthread_mutex_unlock( &this->audio_mutex ); - } - else - { - this->playing = 1; - } - - return init_audio; -} - -static int consumer_play_video( consumer_sdl this, mlt_frame frame ) -{ - // Get the properties of this consumer - mlt_properties properties = this->properties; - - mlt_image_format vfmt = mlt_image_yuv422; - int width = this->width, height = this->height; - uint8_t *image; - int changed = 0; - - if ( mlt_properties_get_int( properties, "video_off" ) ) - { - mlt_frame_close( frame ); - return 0; - } - - if ( this->count == this->size ) - { - this->size += 25; - this->queue = realloc( this->queue, sizeof( mlt_frame ) * this->size ); - } - this->queue[ this->count ++ ] = frame; - - if ( this->playing ) - { - // We're working on the oldest frame now - frame = this->queue[ 0 ]; - - // Shunt the frames in the queue down - int i = 0; - for ( i = 1; i < this->count; i ++ ) - this->queue[ i - 1 ] = this->queue[ i ]; - this->count --; - - // Get the image, width and height - mlt_frame_get_image( frame, &image, &vfmt, &width, &height, 0 ); - - if ( this->sdl_screen != NULL ) - { - SDL_Event event; - - changed = consumer_get_dimensions( &this->window_width, &this->window_height ); - - while ( SDL_PollEvent( &event ) ) - { - switch( event.type ) - { - case SDL_VIDEORESIZE: - this->window_width = event.resize.w; - this->window_height = event.resize.h; - changed = 1; - break; - case SDL_KEYDOWN: - { - mlt_producer producer = mlt_properties_get_data( properties, "transport_producer", NULL ); - char keyboard[ 2 ] = " "; - void (*callback)( mlt_producer, char * ) = mlt_properties_get_data( properties, "transport_callback", NULL ); - if ( callback != NULL && producer != NULL && event.key.keysym.unicode < 0x80 && event.key.keysym.unicode > 0 ) - { - keyboard[ 0 ] = ( char )event.key.keysym.unicode; - callback( producer, keyboard ); - } - } - break; - } - } - - } - - if ( width != this->width || height != this->height ) - { - this->width = width; - this->height = height; - changed = 1; - } - - if ( this->sdl_screen == NULL || changed ) - { - double aspect_ratio = mlt_frame_get_aspect_ratio( frame ); - float display_aspect_ratio = (float)width / (float)height; - SDL_Rect rect; - - if ( mlt_properties_get_double( properties, "aspect_ratio" ) ) - aspect_ratio = mlt_properties_get_double( properties, "aspect_ratio" ); - - if ( aspect_ratio == 1 ) - { - rect.w = this->window_width; - rect.h = this->window_height; - } - else if ( this->window_width < this->window_height * aspect_ratio ) - { - rect.w = this->window_width; - rect.h = this->window_width / aspect_ratio; - } - else - { - rect.w = this->window_height * aspect_ratio; - rect.h = this->window_height; - } - - if ( mlt_properties_get_int( properties, "scale_overlay" ) ) - { - if ( ( float )rect.w * display_aspect_ratio < this->window_width ) - rect.w = ( int )( ( float )rect.w * display_aspect_ratio ); - else if ( ( float )rect.h * display_aspect_ratio < this->window_height ) - rect.h = ( int )( ( float )rect.h * display_aspect_ratio ); - } - - rect.x = ( this->window_width - rect.w ) / 2; - rect.y = ( this->window_height - rect.h ) / 2; - - // Force an overlay recreation - if ( this->sdl_overlay != NULL ) - SDL_FreeYUVOverlay( this->sdl_overlay ); - - // open SDL window with video overlay, if possible - this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, 0, this->sdl_flags ); - - if ( this->sdl_screen != NULL ) - { - SDL_SetClipRect( this->sdl_screen, &rect ); - - sdl_lock_display(); - this->sdl_overlay = SDL_CreateYUVOverlay( this->width - (this->width % 4), this->height- (this->height % 2 ), SDL_YUY2_OVERLAY, this->sdl_screen ); - sdl_unlock_display(); - } - } - - if ( this->sdl_screen != NULL && this->sdl_overlay != NULL ) - { - this->buffer = this->sdl_overlay->pixels[ 0 ]; - if ( SDL_LockYUVOverlay( this->sdl_overlay ) >= 0 ) - { - mlt_resize_yuv422( this->buffer, this->width - (this->width % 4 ), this->height- (this->height % 2 ), image, width, height ); - SDL_UnlockYUVOverlay( this->sdl_overlay ); - SDL_DisplayYUVOverlay( this->sdl_overlay, &this->sdl_screen->clip_rect ); - } - } - } - else - { - frame = NULL; - } - - // Close the frame - if ( frame != NULL ) - mlt_frame_close( frame ); - - if ( this->count ) - mlt_frame_get_image( this->queue[ this->count - 1 ], &image, &vfmt, &width, &height, 0 ); - - return 0; -} - -/** Threaded wrapper for pipe. -*/ - -static void *consumer_thread( void *arg ) -{ - // Identify the arg - consumer_sdl this = arg; - - // Get the consumer - mlt_consumer consumer = &this->parent; - - // Get the service assoicated to the consumer - mlt_service service = mlt_consumer_service( consumer ); - - // Define a frame pointer - mlt_frame frame; - - // internal intialization - int init_audio = 1; - - if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE ) < 0 ) - { - fprintf( stderr, "Failed to initialize SDL: %s\n", SDL_GetError() ); - return NULL; - } - - // Loop until told not to - while( this->running ) - { - // Get a frame from the service (should never return anything other than 0) - if ( mlt_service_get_frame( service, &frame, 0 ) == 0 ) - { - init_audio = consumer_play_audio( this, frame, init_audio ); - consumer_play_video( this, frame ); - } - } - - // internal cleanup - if ( init_audio == 0 ) - SDL_AudioQuit( ); - if ( this->sdl_overlay != NULL ) - SDL_FreeYUVOverlay( this->sdl_overlay ); - SDL_Quit( ); - - this->sdl_screen = NULL; - this->sdl_overlay = NULL; - this->audio_avail = 0; - - return NULL; -} - -static int consumer_get_dimensions( int *width, int *height ) -{ - int changed = 0; - - // SDL windows manager structure - SDL_SysWMinfo wm; - - // Specify the SDL Version - SDL_VERSION( &wm.version ); - - // Get the wm structure - if ( SDL_GetWMInfo( &wm ) == 1 ) - { - // Check that we have the X11 wm - if ( wm.subsystem == SDL_SYSWM_X11 ) - { - // Get the SDL window - Window window = wm.info.x11.window; - - // Get the display session - Display *display = wm.info.x11.display; - - // Get the window attributes - XWindowAttributes attr; - XGetWindowAttributes( display, window, &attr ); - - // Determine whether window has changed - changed = *width != attr.width || *height != attr.height; - - // Return width and height - *width = attr.width; - *height = attr.height; - } - } - - return changed; -} - -/** Callback to allow override of the close method. -*/ - -static void consumer_close( mlt_consumer parent ) -{ - // Get the actual object - consumer_sdl this = parent->child; - - // Stop the consumer - mlt_consumer_stop( parent ); - - // Destroy mutexes - pthread_mutex_destroy( &this->audio_mutex ); - pthread_cond_destroy( &this->audio_cond ); - - // Now clean up the rest - mlt_consumer_close( parent ); - - // Finally clean up this - free( this ); -} - diff --git a/mlt/src/modules/sdl/consumer_sdl.h b/mlt/src/modules/sdl/consumer_sdl.h deleted file mode 100644 index bf2fefd..0000000 --- a/mlt/src/modules/sdl/consumer_sdl.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * consumer_sdl.h -- A Simple DirectMedia Layer consumer - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _CONSUMER_SDL_H_ -#define _CONSUMER_SDL_H_ - -#include - -extern mlt_consumer consumer_sdl_init( char * ); - -#endif diff --git a/mlt/src/modules/sdl/factory.c b/mlt/src/modules/sdl/factory.c deleted file mode 100644 index 9e5f56e..0000000 --- a/mlt/src/modules/sdl/factory.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * factory.c -- the factory method interfaces - * 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 program 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. - * - * 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. - */ - -#include - -#include "consumer_sdl.h" - -void *mlt_create_producer( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_filter( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_transition( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_consumer( char *id, void *arg ) -{ - if ( !strcmp( id, "sdl" ) ) - return consumer_sdl_init( arg ); - return NULL; -} - diff --git a/mlt/src/modules/westley/Makefile b/mlt/src/modules/westley/Makefile deleted file mode 100644 index 576a6ea..0000000 --- a/mlt/src/modules/westley/Makefile +++ /dev/null @@ -1,30 +0,0 @@ - -TARGET = ../libmltwestley.so - -OBJS = factory.o \ - consumer_westley.o \ - producer_westley.o - -CFLAGS = -I../../ -Wall -g -D_FILE_OFFSET_BITS=64 -pthread `xml2-config --cflags` - -LDFLAGS = `xml2-config --libs` - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) -shared -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/modules/westley/configure b/mlt/src/modules/westley/configure deleted file mode 100755 index b971570..0000000 --- a/mlt/src/modules/westley/configure +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -if [ "$help" != "1" ] -then - -cat << EOF >> ../producers.dat -westley libmltwestley.so -EOF - -cat << EOF >> ../consumers.dat -westley libmltwestley.so -EOF - -fi - diff --git a/mlt/src/modules/westley/consumer_westley.c b/mlt/src/modules/westley/consumer_westley.c deleted file mode 100644 index 3019351..0000000 --- a/mlt/src/modules/westley/consumer_westley.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * consumer_westley.c -- a libxml2 serialiser of mlt service networks - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#include "consumer_westley.h" -#include -#include -#include -#include -#include -#include - -/** Forward references to static functions. -*/ - -static int consumer_start( mlt_consumer parent ); - -/** This is what will be called by the factory - anything can be passed in - via the argument, but keep it simple. -*/ - -mlt_consumer consumer_westley_init( char *arg ) -{ - // Create the consumer object - mlt_consumer this = calloc( sizeof( struct mlt_consumer_s ), 1 ); - - // If no malloc'd and consumer init ok - if ( this != NULL && mlt_consumer_init( this, NULL ) == 0 ) - { - // We have stuff to clean up, so override the close method - //parent->close = consumer_close; - - // Allow thread to be started/stopped - this->start = consumer_start; - - // Return the consumer produced - return this; - } - - // malloc or consumer init failed - free( this ); - - // Indicate failure - return NULL; -} - - -// This maintains counters for adding ids to elements -struct serialise_context_s -{ - int producer_count; - int multitrack_count; - int playlist_count; - int tractor_count; - int filter_count; - int transition_count; -}; -typedef struct serialise_context_s* serialise_context; - - -static inline void serialise_properties( mlt_properties properties, xmlNode *node ) -{ - int i; - xmlNode *p; - - // Enumerate the properties - for ( i = 0; i < mlt_properties_count( properties ); i++ ) - { -#if 0 - p = xmlNewChild( node, NULL, "prop", NULL ); -#else - p = node; -#endif - xmlNewProp( p, mlt_properties_get_name( properties, i ), mlt_properties_get_value( properties, i ) ); - } -} - -static xmlNode* serialise_service( serialise_context context, mlt_service service, xmlNode *node ) -{ - int i; - xmlNode *child = node; - char id[ 31 ]; - id[ 30 ] = '\0'; - - // Iterate over consumer/producer connections - while ( service != NULL ) - { - mlt_properties properties = mlt_service_properties( service ); - char *mlt_type = mlt_properties_get( properties, "mlt_type" ); - - // Tell about the producer - if ( strcmp( mlt_type, "producer" ) == 0 ) - { - child = xmlNewChild( node, NULL, "producer", NULL ); - - // Set the id - if ( mlt_properties_get( properties, "id" ) != NULL ) - xmlNewProp( child, "id", mlt_properties_get( properties, "mlt_service" ) ); - else - { - snprintf( id, 30, "producer%d", context->producer_count++ ); - xmlNewProp( child, "id", id ); - } - - //xmlNewProp( child, "type", mlt_properties_get( properties, "mlt_service" ) ); - //xmlNewProp( child, "src", mlt_properties_get( properties, "resource" ) ); - serialise_properties( properties, child ); - } - - // Tell about the framework container producers - else if ( strcmp( mlt_type, "mlt_producer" ) == 0 ) - { - // Recurse on multitrack's tracks - if ( strcmp( mlt_properties_get( properties, "resource" ), "" ) == 0 ) - { - child = xmlNewChild( node, NULL, "multitrack", NULL ); - - // Set the id - if ( mlt_properties_get( properties, "id" ) != NULL ) - xmlNewProp( child, "id", mlt_properties_get( properties, "mlt_service" ) ); - else - { - snprintf( id, 30, "multitrack%d", context->multitrack_count++ ); - xmlNewProp( child, "id", id ); - } - - // Iterate over the tracks - for ( i = 0; i < mlt_multitrack_count( MLT_MULTITRACK( service ) ); i++ ) - { - xmlNode *track = xmlNewChild( child, NULL, "track", NULL ); - serialise_service( context, MLT_SERVICE( mlt_multitrack_track( MLT_MULTITRACK( service ), i ) ), track ); - } - break; - } - - // Recurse on playlist's clips - else if ( strcmp( mlt_properties_get( properties, "resource" ), "" ) == 0 ) - { - mlt_playlist_clip_info info; - child = xmlNewChild( node, NULL, "playlist", NULL ); - - // Set the id - if ( mlt_properties_get( properties, "id" ) != NULL ) - xmlNewProp( child, "id", mlt_properties_get( properties, "mlt_service" ) ); - else - { - snprintf( id, 30, "playlist%d", context->playlist_count++ ); - xmlNewProp( child, "id", id ); - } - - xmlNewProp( child, "in", mlt_properties_get( properties, "in" ) ); - xmlNewProp( child, "out", mlt_properties_get( properties, "out" ) ); - - // Iterate over the playlist entries - for ( i = 0; i < mlt_playlist_count( MLT_PLAYLIST( service ) ); i++ ) - { - if ( ! mlt_playlist_get_clip_info( MLT_PLAYLIST( service ), &info, i ) ) - { - if ( strcmp( mlt_properties_get( mlt_producer_properties( info.producer ), "mlt_service" ), "blank" ) == 0 ) - { - char length[ 20 ]; - length[ 19 ] = '\0'; - xmlNode *entry = xmlNewChild( child, NULL, "blank", NULL ); - snprintf( length, 19, "%lld", info.length ); - xmlNewProp( entry, "length", length ); - } - else - { - xmlNode *entry = xmlNewChild( child, NULL, "entry", NULL ); - serialise_service( context, MLT_SERVICE( info.producer ), entry ); - } - } - } - } - - // Recurse on tractor's producer - else if ( strcmp( mlt_properties_get( properties, "resource" ), "" ) == 0 ) - { - child = xmlNewChild( node, NULL, "tractor", NULL ); - - // Set the id - if ( mlt_properties_get( properties, "id" ) != NULL ) - xmlNewProp( child, "id", mlt_properties_get( properties, "mlt_service" ) ); - else - { - snprintf( id, 30, "tractor%d", context->tractor_count++ ); - xmlNewProp( child, "id", id ); - } - - // Recurse on connected producer - serialise_service( context, mlt_service_get_producer( service ), child ); - - break; - } - } - - // Tell about a filter - else if ( strcmp( mlt_type, "filter" ) == 0 ) - { - // Recurse on connected producer - child = serialise_service( context, MLT_SERVICE( MLT_FILTER( service )->producer ), node ); - - // sanity check - if ( child == NULL ) - break; - - node = xmlNewChild( child, NULL, "filter", NULL ); - - // Set the id - if ( mlt_properties_get( properties, "id" ) != NULL ) - xmlNewProp( node, "id", mlt_properties_get( properties, "mlt_service" ) ); - else - { - snprintf( id, 30, "filter%d", context->filter_count++ ); - xmlNewProp( node, "id", id ); - } - - //xmlNewProp( node, "type", mlt_properties_get( properties, "mlt_service" ) ); - - serialise_properties( properties, node ); - - break; - } - - // Tell about a transition - else if ( strcmp( mlt_type, "transition" ) == 0 ) - { - // Recurse on connected producer - child = serialise_service( context, MLT_SERVICE( MLT_TRANSITION( service )->producer ), node ); - - // sanity check - if ( child == NULL ) - break; - - node = xmlNewChild( child, NULL, "transition", NULL ); - - // Set the id - if ( mlt_properties_get( properties, "id" ) != NULL ) - xmlNewProp( node, "id", mlt_properties_get( properties, "mlt_service" ) ); - else - { - snprintf( id, 30, "transition%d", context->transition_count++ ); - xmlNewProp( node, "id", id ); - } - - //xmlNewProp( node, "type", mlt_properties_get( properties, "mlt_service" ) ); - - serialise_properties( properties, node ); - - break; - } - - // Get the next connected service - service = mlt_service_get_producer( service ); - } - return child; -} - -static int consumer_start( mlt_consumer this ) -{ - mlt_service inigo = NULL; - xmlDoc *doc = xmlNewDoc( "1.0" ); - xmlNode *root = xmlNewNode( NULL, "westley" ); - xmlDocSetRootElement( doc, root ); - - // Get the producer service - mlt_service service = mlt_service_get_producer( mlt_consumer_service( this ) ); - if ( service != NULL ) - { - struct serialise_context_s context; - memset( &context, 0, sizeof( struct serialise_context_s ) ); - - // Remember inigo - if ( mlt_properties_get( mlt_service_properties( service ), "mlt_service" ) != NULL && - strcmp( mlt_properties_get( mlt_service_properties( service ), "mlt_service" ), "inigo" ) == 0 ) - { - inigo = service; - - // Turn inigo's producer into a framework producer - mlt_properties_set( mlt_service_properties( service ), "mlt_type", "mlt_producer" ); - } - - serialise_service( &context, service, root ); - xmlDocFormatDump( stderr, doc, 1 ); - } - - xmlFreeDoc( doc ); - mlt_consumer_stop( this ); - - // Tell inigo, enough already! - if ( inigo != NULL ) - mlt_properties_set_int( mlt_service_properties( inigo ), "done", 1 ); - - return 0; -} - diff --git a/mlt/src/modules/westley/consumer_westley.h b/mlt/src/modules/westley/consumer_westley.h deleted file mode 100644 index 8b94db4..0000000 --- a/mlt/src/modules/westley/consumer_westley.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * consumer_westley.h -- a libxml2 serialiser of mlt service networks - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _CONSUMER_WESTLEY_H_ -#define _CONSUMER_WESTLEY_H_ - -#include - -extern mlt_consumer consumer_westley_init( char * ); - -#endif diff --git a/mlt/src/modules/westley/factory.c b/mlt/src/modules/westley/factory.c deleted file mode 100644 index e60cd56..0000000 --- a/mlt/src/modules/westley/factory.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * factory.c -- the factory method interfaces - * 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 program 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. - * - * 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. - */ - -#include - -#include "consumer_westley.h" -#include "producer_westley.h" - -void *mlt_create_producer( char *id, void *arg ) -{ - if ( !strcmp( id, "westley" ) ) - return producer_westley_init( arg ); - return NULL; -} - -void *mlt_create_filter( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_transition( char *id, void *arg ) -{ - return NULL; -} - -void *mlt_create_consumer( char *id, void *arg ) -{ - if ( !strcmp( id, "westley" ) ) - return consumer_westley_init( arg ); - return NULL; -} - diff --git a/mlt/src/modules/westley/producer_westley.c b/mlt/src/modules/westley/producer_westley.c deleted file mode 100644 index 6616f3c..0000000 --- a/mlt/src/modules/westley/producer_westley.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * producer_libdv.c -- a libxml2 parser of mlt service networks - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#include "producer_westley.h" -#include -#include -#include -#include - -#include - -static mlt_producer parse_westley( char *file ) -{ - return NULL; -} - -mlt_producer producer_westley_init( char *filename ) -{ - int i; - int track = 0; - mlt_producer producer = NULL; - mlt_playlist playlist = mlt_playlist_init( ); - mlt_properties group = mlt_properties_new( ); - mlt_properties properties = group; - mlt_field field = mlt_field_init( ); - mlt_properties field_properties = mlt_field_properties( field ); - mlt_multitrack multitrack = mlt_field_multitrack( field ); - - // We need to track the number of registered filters - mlt_properties_set_int( field_properties, "registered", 0 ); - - // Parse - producer = parse_westley( filename ); - - // TODO - - // Connect producer to playlist - if ( producer != NULL ) - mlt_playlist_append( playlist, producer ); - - // We must have a producer at this point - if ( mlt_playlist_count( playlist ) > 0 ) - { - // Connect multitrack to producer - mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist ), track ); - } - - mlt_tractor tractor = mlt_field_tractor( field ); - mlt_producer prod = mlt_tractor_producer( tractor ); - mlt_properties props = mlt_tractor_properties( tractor ); - mlt_properties_set( mlt_producer_properties( prod ), "resource", filename ); - mlt_properties_set_data( props, "multitrack", multitrack, 0, NULL, NULL ); - mlt_properties_set_data( props, "field", field, 0, NULL, NULL ); - mlt_properties_set_data( props, "group", group, 0, NULL, NULL ); - mlt_properties_set_position( props, "length", mlt_producer_get_out( mlt_multitrack_producer( multitrack ) ) + 1 ); - mlt_producer_set_in_and_out( prod, 0, mlt_producer_get_out( mlt_multitrack_producer( multitrack ) ) ); - mlt_properties_set_double( props, "fps", mlt_producer_get_fps( mlt_multitrack_producer( multitrack ) ) ); - - return mlt_tractor_producer( tractor ); -} - diff --git a/mlt/src/modules/westley/producer_westley.h b/mlt/src/modules/westley/producer_westley.h deleted file mode 100644 index 979a0d7..0000000 --- a/mlt/src/modules/westley/producer_westley.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_westley.h -- a libxml2 parser of mlt service networks - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 program 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. - * - * 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. - */ - -#ifndef _PRODUCER_WESTLEY_H_ -#define _PRODUCER_WESTLEY_H_ - -#include - -extern mlt_producer producer_westley_init( char *filename ); - -#endif diff --git a/mlt/src/tests/Makefile b/mlt/src/tests/Makefile deleted file mode 100644 index 3c7dd78..0000000 --- a/mlt/src/tests/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -TARGET = dan charlie pango pixbuf dissolve luma - -CFLAGS = -I .. -Wall -rdynamic -pthread - -LDFLAGS = -L ../framework -lmlt - -all: $(TARGET) - -pango: pango.o - $(CC) pango.o -o $@ $(LDFLAGS) - -pixbuf: pixbuf.o - $(CC) pixbuf.o -o $@ $(LDFLAGS) - -dissolve: dissolve.o - $(CC) dissolve.o -o $@ $(LDFLAGS) - -luma: luma.o - $(CC) luma.o -o $@ $(LDFLAGS) - -dan: dan.o - $(CC) dan.o -o $@ $(LDFLAGS) - -charlie: charlie.o io.o - $(CC) charlie.o io.o -o $@ $(LDFLAGS) - -clean: - rm -f dan.o io.o charlie.o dan charlie - -depend: dan.c charlie.c io.c - $(CC) -MM $(CFLAGS) $^ 1>.depend - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/tests/charlie.c b/mlt/src/tests/charlie.c deleted file mode 100644 index f4086e4..0000000 --- a/mlt/src/tests/charlie.c +++ /dev/null @@ -1,191 +0,0 @@ -#include -#include -#include - -#include - -#include "io.h" - -mlt_producer create_producer( char *file ) -{ - mlt_producer result = NULL; - - // 1st Line preferences - if ( strstr( file, ".inigo" ) ) - { - char *args[ 2 ] = { file, NULL }; - result = mlt_factory_producer( "inigo", args ); - } - else if ( strstr( file, ".mpg" ) ) - result = mlt_factory_producer( "mcmpeg", file ); - else if ( strstr( file, ".mpeg" ) ) - result = mlt_factory_producer( "mcmpeg", file ); - else if ( strstr( file, ".dv" ) ) - result = mlt_factory_producer( "mcdv", file ); - else if ( strstr( file, ".dif" ) ) - result = mlt_factory_producer( "mcdv", file ); - else if ( strstr( file, ".jpg" ) ) - result = mlt_factory_producer( "pixbuf", file ); - else if ( strstr( file, ".JPG" ) ) - result = mlt_factory_producer( "pixbuf", file ); - else if ( strstr( file, ".jpeg" ) ) - result = mlt_factory_producer( "pixbuf", file ); - else if ( strstr( file, ".png" ) ) - result = mlt_factory_producer( "pixbuf", file ); - - // 2nd Line fallbacks - if ( result == NULL && strstr( file, ".dv" ) ) - result = mlt_factory_producer( "libdv", file ); - else if ( result == NULL && strstr( file, ".dif" ) ) - result = mlt_factory_producer( "libdv", file ); - - return result; -} - -void transport_action( mlt_producer producer, char *value ) -{ - mlt_properties properties = mlt_producer_properties( producer ); - - switch( value[ 0 ] ) - { - case 'q': - mlt_properties_set_int( properties, "done", 1 ); - break; - case '0': - mlt_producer_set_speed( producer, 1 ); - mlt_producer_seek( producer, 0 ); - break; - case '1': - mlt_producer_set_speed( producer, -5 ); - break; - case '2': - mlt_producer_set_speed( producer, -2.5 ); - break; - case '3': - mlt_producer_set_speed( producer, -1 ); - break; - case '4': - mlt_producer_set_speed( producer, -0.5 ); - break; - case '5': - mlt_producer_set_speed( producer, 0 ); - break; - case '6': - mlt_producer_set_speed( producer, 0.5 ); - break; - case '7': - mlt_producer_set_speed( producer, 1 ); - break; - case '8': - mlt_producer_set_speed( producer, 2.5 ); - break; - case '9': - mlt_producer_set_speed( producer, 5 ); - break; - } -} - -mlt_consumer create_consumer( char *id, mlt_producer producer ) -{ - char *arg = strchr( id, ':' ); - if ( arg != NULL ) - *arg ++ = '\0'; - mlt_consumer consumer = mlt_factory_consumer( id, arg ); - if ( consumer != NULL ) - { - mlt_properties properties = mlt_consumer_properties( consumer ); - mlt_properties_set_data( properties, "transport_callback", transport_action, 0, NULL, NULL ); - mlt_properties_set_data( properties, "transport_producer", producer, 0, NULL, NULL ); - } - return consumer; -} - -void track_service( mlt_field field, void *service, mlt_destructor destructor ) -{ - mlt_properties properties = mlt_field_properties( field ); - int registered = mlt_properties_get_int( properties, "registered" ); - char *key = mlt_properties_get( properties, "registered" ); - mlt_properties_set_data( properties, key, service, 0, destructor, NULL ); - mlt_properties_set_int( properties, "registered", ++ registered ); -} - -void set_properties( mlt_service service, char *namevalue ) -{ - mlt_properties properties = mlt_service_properties( service ); - mlt_properties_parse( properties, namevalue ); -} - -void transport( mlt_producer producer ) -{ - mlt_properties properties = mlt_producer_properties( producer ); - - term_init( ); - fprintf( stderr, "Press 'q' to continue\n" ); - while( mlt_properties_get_int( properties, "done" ) == 0 ) - { - int value = term_read( ); - if ( value != -1 ) - transport_action( producer, ( char * )&value ); - } -} - -int main( int argc, char **argv ) -{ - int i; - mlt_service service = NULL; - mlt_consumer consumer = NULL; - mlt_producer producer = NULL; - mlt_playlist playlist = NULL; - - // Construct the factory - mlt_factory_init( getenv( "MLT_REPOSITORY" ) ); - - // Set up containers - playlist = mlt_playlist_init( ); - - // Parse the arguments - for ( i = 1; i < argc; i ++ ) - { - if ( !strcmp( argv[ i ], "-consumer" ) ) - { - consumer = create_consumer( argv[ ++ i ], mlt_playlist_producer( playlist ) ); - if ( consumer != NULL ) - service = mlt_consumer_service( consumer ); - } - else if ( !strstr( argv[ i ], "=" ) ) - { - if ( producer != NULL ) - mlt_playlist_append( playlist, producer ); - producer = create_producer( argv[ i ] ); - if ( producer != NULL ) - service = mlt_producer_service( producer ); - } - else - { - set_properties( service, argv[ i ] ); - } - } - - // If we have no consumer, default to sdl - if ( consumer == NULL ) - consumer = create_consumer( "sdl", mlt_playlist_producer( playlist ) ); - - // Connect producer to playlist - if ( producer != NULL ) - mlt_playlist_append( playlist, producer ); - - // Connect consumer to playlist - mlt_consumer_connect( consumer, mlt_playlist_service( playlist ) ); - - // Transport functionality - transport( mlt_playlist_producer( playlist ) ); - - // Close the services - mlt_consumer_close( consumer ); - mlt_playlist_close( playlist ); - - // Close the factory - mlt_factory_close( ); - - return 0; -} diff --git a/mlt/src/tests/clock16ntsc.pgm b/mlt/src/tests/clock16ntsc.pgm deleted file mode 100644 index 61e64ad3fb834f1c08414c1d8419182318a6ac0c..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 691217 zc-rmUcl>vES>N$m7XpuJOQndmO|4p1B#cOaXsc}zR7As)p+Qyzg3J(>y+JmF6@jqy z1_A;S1wmAXtt4y`Mj%PWwrLT;5f!1JV%zjSIULUVjB8)l=X}rS@BEwR{eHZz^ZotA ziC4eHO;0%P<|mzS_3u0J#G9RX^~*BvzXIMLRNp6y?+=UbzZKqp&%XbWd6#G2|4hFB zm3*H{ygy33Pp{q|uij@?@3X7-CyV!|i}z=X_vf>B#p35-j^ru?EeCs z;$3_3{@LPPXZ5~q^{%^m-=28ik$C?+`Tj-X{maZdF7y6X_I+pe{p-T}uHyUd%KM(` z`!}F>y<_jP!rO)R75Y#9q%3sV=cUjRKF@{TeNOp&jcee2meIN9b4};9&k&tcKJ#?W z`Fuz^U+*jLvdefv*Ny(y3!(*{W?s*SUqRasBHtjYE1tOBIgDKI5)~7IkCS`H*zJ{^DJF=`M83LTfK*?ZQF* z0@}~#ICTT_U7cTfJ_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l;D71Bnwq4Otm-C_NyruOldmXHO{p{tlMuC=J(A>r$ z_az5k=yp1XoY7v(xwY!tlFriWS-w6;_1U99Q*MOu8^_j#wp!8KS)mMG6UZNqjw z*X#2(eAX%)@CCgK9iwwd7%gw}uCsP|Zf8AH>oex-XIr1O3$(_9mTw$~BD8KD)QZ9`@~!)}A}b;H(Y*)KRa1zLJR>o$&EXfLB%Sb+&ICxUZfq*RzJt^{?w%^O;gO z;xrD)3LQ;o@6J&(dK=4mTRPjVXXtGZ|7~3)pX+~tL*ok$zrw*?(6q+Exf8Z3wEl|T z!gAKtS@td{U!HZ=vsT@pUk5#W_AMNx->G;nXz9igS7_fAExDXybq#-=b=n5!GAO;C zwd?bCeD+NXG-CK-w1UV^e(h)=b#!Le>v|u zOSKJ&+aRoN#Pu2X3qrilnuSAhL2EUR=tBFIXqwO#%h|d*TkA|M&-}Jwv7WhgWBWdP z6%N@e;kJZsw{y&m_Fm3y=`48{jJuv~>W2KU2eCe5zp%3@&~X;DcH`Kd(DEyK*I8a? ft+wI6o@3N!ZJ#X)v`pdPEohl9?RKFxSM>h}-xEV0 diff --git a/mlt/src/tests/clock16pal.pgm b/mlt/src/tests/clock16pal.pgm deleted file mode 100644 index 4d7b0fcd8031f6eabc877d2e2c86e0e287e52f1a..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 829457 zc-rjUXV_K6)dt|?(H#xvu>3VLR(S&)Q>yRvWFm_VOESv|+0aH`rjk z4O)#t&S=6JV?ASyXPohjH=GIRnTVW^kn=HkJ^|0C!1)X~leF`>b|!1*3+;TVoGHqg zs+_N+^R;rmk&iuk@C7ss7SwJ}QpIT5l3rS~T>HJkX zi%4ft>HJMOiz#Pu+Z!`Me02&x?Zj{5K$< z7X$KnaV?*h(DM23T0Z~7n$JtI@_E@3@_FT!e75HEXoq|rFU9i&DV`@v@%)h#&mXh$ z`7ao!&)*>N{4E;K-=XpRy&;~b8RL1nC7x$k<9Q|_ zoM){z%aqS?MsI0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PKiHt3ZN z>SdHLvynz^$k#TY)AK8X?lxYGJUu^0o}Q@}Q>1p|Nzv`bVf&>Z$UN7S1r@nR#?Y~V{9In_o|x8W~taBrn>r)ToL6!OIs zvE4{``#f`;5zkx0Z>I>>HzM*G{X*peBcE4BHH7#I#}eTU2i*}8OB{gWa8J++X~iLV zRVBu8 - -#include - -int main( int argc, char **argv ) -{ - char temp[ 132 ]; - char *file1 = NULL; - char *file2 = NULL; - - mlt_factory_init( "../modules" ); - - if ( argc >= 2 ) - file1 = argv[ 1 ]; - if ( argc >= 3 ) - file2 = argv[ 2 ]; - - // Start the consumer... - int vstd = mlt_video_standard_ntsc; - //mlt_consumer consumer = mlt_factory_consumer( "bluefish", &vstd ); - mlt_consumer consumer = mlt_factory_consumer( "westley", "PAL" ); - - // Create the producer(s) - mlt_producer dv1 = mlt_factory_producer( "libdv", file1 ); - mlt_producer_set_in_and_out( dv1, 0, 5 ); - - mlt_producer dv2 = mlt_factory_producer( "libdv", file2 ); - //mlt_producer_set_in_and_out( dv2, 10.0, 30.0 ); - -#if 0 - // Connect the consumer to the producer - mlt_consumer_connect( consumer, mlt_producer_service( dv2 ) ); - - // Do stuff until we're told otherwise... - fprintf( stderr, "Press return to continue\n" ); - fgets( temp, 132, stdin ); - mlt_consumer_close( consumer ); - return 0; -#endif - - //mlt_producer dv1 = producer_pixbuf_init( file1 ); - //mlt_producer dv2 = producer_libdv_init( file2 ); - //mlt_producer dv2 = mlt_factory_producer( "pixbuf", file2 ); -#if 0 - mlt_producer title = mlt_factory_producer( "pango", NULL ); //"Mutton Lettuce Tomato" ); - mlt_properties_set_int( mlt_producer_properties( title ), "video_standard", mlt_video_standard_ntsc ); - mlt_properties_set( mlt_producer_properties( title ), "font", "Sans Bold 36" ); - mlt_properties_set( mlt_producer_properties( title ), "text", "Mutton Lettuce\nTomato" ); - mlt_properties_set_int( mlt_producer_properties( title ), "bgcolor", 0x0000007f ); - mlt_properties_set_int( mlt_producer_properties( title ), "pad", 8 ); - mlt_properties_set_int( mlt_producer_properties( title ), "align", 1 ); - mlt_properties_set_int( mlt_producer_properties( title ), "x", 20 ); - mlt_properties_set_int( mlt_producer_properties( title ), "y", 40 ); -#endif - - mlt_playlist playlist1 = mlt_playlist_init(); - mlt_playlist_append( playlist1, dv1 ); - mlt_playlist_blank( playlist1, 1.0 ); - - mlt_playlist playlist2 = mlt_playlist_init(); - mlt_playlist_blank( playlist2, 3.0 ); - mlt_playlist_append( playlist2, dv2 ); - - // Register producers(s) with a multitrack object - mlt_multitrack multitrack = mlt_multitrack_init( ); - mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist1 ), 0 ); - mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist2 ), 1 ); - - // Create a filter and associate it to track 0 - //mlt_filter filter = mlt_factory_filter( "deinterlace", NULL ); - //mlt_filter_connect( filter, mlt_multitrack_service( multitrack ), 0 ); - //mlt_filter_set_in_and_out( filter, 0, 1000 ); - - // Define a transition - mlt_transition transition = mlt_factory_transition( "luma", NULL ); - mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 ); - mlt_transition_set_in_and_out( transition, 3.0, 5.0 ); - //mlt_properties_set( mlt_transition_properties( transition ), "filename", "clock.pgm" ); - mlt_properties_set_double( mlt_transition_properties( transition ), "softness", 0.1 ); - - // Buy a tractor and connect it to the filter - mlt_tractor tractor = mlt_tractor_init( ); - mlt_tractor_connect( tractor, mlt_transition_service( transition ) ); - - // Connect the tractor to the consumer - mlt_consumer_connect( consumer, mlt_tractor_service( tractor ) ); - - // Do stuff until we're told otherwise... - fprintf( stderr, "Press return to continue\n" ); - fgets( temp, 132, stdin ); - - // Close everything... - mlt_consumer_close( consumer ); - mlt_tractor_close( tractor ); - mlt_transition_close( transition ); - mlt_multitrack_close( multitrack ); - mlt_producer_close( dv1 ); - mlt_producer_close( dv2 ); - - return 0; -} diff --git a/mlt/src/tests/dissolve.c b/mlt/src/tests/dissolve.c deleted file mode 100644 index d9ce2d7..0000000 --- a/mlt/src/tests/dissolve.c +++ /dev/null @@ -1,71 +0,0 @@ - -#include - -#include - -int main( int argc, char **argv ) -{ - char temp[ 132 ]; - char *file1 = NULL; - char *file2 = NULL; - - mlt_factory_init( "../modules" ); - - if ( argc < 3 ) - { - fprintf( stderr, "usage: dissolve file1.mpeg file2.mpeg\n" ); - return 1; - } - else - { - file1 = argv[ 1 ]; - file2 = argv[ 2 ]; - } - - // Start the consumer... - mlt_consumer consumer = mlt_factory_consumer( "sdl", "PAL" ); - - // Create the producer(s) - mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 ); - mlt_producer dv2 = mlt_factory_producer( "mcmpeg", file2 ); - - mlt_playlist playlist1 = mlt_playlist_init(); - mlt_playlist_append_io( playlist1, dv1, 0.0, 5.0 ); - - mlt_playlist playlist2 = mlt_playlist_init(); - mlt_playlist_blank( playlist2, 2.9 ); - mlt_playlist_append( playlist2, dv2 ); - - // Register producers(s) with a multitrack object - mlt_multitrack multitrack = mlt_multitrack_init( ); - mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist1 ), 0 ); - mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist2 ), 1 ); - - // Define a transition - mlt_transition transition = mlt_factory_transition( "luma", NULL ); - mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 ); - mlt_transition_set_in_and_out( transition, 3.0, 5.0 ); - - // Buy a tractor and connect it to the filter - mlt_tractor tractor = mlt_tractor_init( ); - mlt_tractor_connect( tractor, mlt_transition_service( transition ) ); - - // Connect the tractor to the consumer - mlt_consumer_connect( consumer, mlt_tractor_service( tractor ) ); - - // Do stuff until we're told otherwise... - fprintf( stderr, "Press return to continue\n" ); - fgets( temp, 132, stdin ); - - // Close everything... - mlt_consumer_close( consumer ); - mlt_tractor_close( tractor ); - mlt_transition_close( transition ); - mlt_multitrack_close( multitrack ); - mlt_playlist_close( playlist1 ); - mlt_playlist_close( playlist2 ); - mlt_producer_close( dv1 ); - mlt_producer_close( dv2 ); - - return 0; -} diff --git a/mlt/src/tests/io.c b/mlt/src/tests/io.c deleted file mode 100644 index 431003d..0000000 --- a/mlt/src/tests/io.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * io.c -- dv1394d client demo input/output - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* System header files */ -#include -#include -#include -#include -#include -#include - -/* Application header files */ -#include "io.h" - -char *chomp( char *input ) -{ - if ( input != NULL ) - { - int length = strlen( input ); - if ( length && input[ length - 1 ] == '\n' ) - input[ length - 1 ] = '\0'; - if ( length > 1 && input[ length - 2 ] == '\r' ) - input[ length - 2 ] = '\0'; - } - return input; -} - -char *trim( char *input ) -{ - if ( input != NULL ) - { - int length = strlen( input ); - int first = 0; - while( first < length && isspace( input[ first ] ) ) - first ++; - memmove( input, input + first, length - first + 1 ); - length = length - first; - while ( length > 0 && isspace( input[ length - 1 ] ) ) - input[ -- length ] = '\0'; - } - return input; -} - -char *strip_quotes( char *input ) -{ - if ( input != NULL ) - { - char *ptr = strrchr( input, '\"' ); - if ( ptr != NULL ) - *ptr = '\0'; - if ( input[ 0 ] == '\"' ) - strcpy( input, input + 1 ); - } - return input; -} - -char *get_string( char *output, int maxlength, char *use ) -{ - char *value = NULL; - strcpy( output, use ); - if ( trim( chomp( fgets( output, maxlength, stdin ) ) ) != NULL ) - { - if ( !strcmp( output, "" ) ) - strcpy( output, use ); - value = output; - } - return value; -} - -int *get_int( int *output, int use ) -{ - int *value = NULL; - char temp[ 132 ]; - *output = use; - if ( trim( chomp( fgets( temp, 132, stdin ) ) ) != NULL ) - { - if ( strcmp( temp, "" ) ) - *output = atoi( temp ); - value = output; - } - return value; -} - -/** This stores the previous settings -*/ - -static struct termios oldtty; -static int mode = 0; - -/** This is called automatically on application exit to restore the - previous tty settings. -*/ - -void term_exit(void) -{ - if ( mode == 1 ) - { - tcsetattr( 0, TCSANOW, &oldtty ); - mode = 0; - } -} - -/** Init terminal so that we can grab keys without blocking. -*/ - -void term_init( ) -{ - struct termios tty; - - tcgetattr( 0, &tty ); - oldtty = tty; - - tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); - tty.c_oflag |= OPOST; - tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN); - tty.c_cflag &= ~(CSIZE|PARENB); - tty.c_cflag |= CS8; - tty.c_cc[ VMIN ] = 1; - tty.c_cc[ VTIME ] = 0; - - tcsetattr( 0, TCSANOW, &tty ); - - mode = 1; - - atexit( term_exit ); -} - -/** Check for a keypress without blocking infinitely. - Returns: ASCII value of keypress or -1 if no keypress detected. -*/ - -int term_read( ) -{ - int n = 1; - unsigned char ch; - struct timeval tv; - fd_set rfds; - - FD_ZERO( &rfds ); - FD_SET( 0, &rfds ); - tv.tv_sec = 0; - tv.tv_usec = 250; - n = select( 1, &rfds, NULL, NULL, &tv ); - if (n > 0) - { - n = read( 0, &ch, 1 ); - tcflush( 0, TCIFLUSH ); - if (n == 1) - return ch; - return n; - } - return -1; -} - -char get_keypress( ) -{ - char value = '\0'; - int pressed = 0; - - fflush( stdout ); - - term_init( ); - while ( ( pressed = term_read( ) ) == -1 ) ; - term_exit( ); - - value = (char)pressed; - - return value; -} - -void wait_for_any_key( char *message ) -{ - if ( message == NULL ) - printf( "Press any key to continue: " ); - else - printf( "%s", message ); - - get_keypress( ); - - printf( "\n\n" ); -} - -void beep( ) -{ - printf( "%c", 7 ); - fflush( stdout ); -} diff --git a/mlt/src/tests/io.h b/mlt/src/tests/io.h deleted file mode 100644 index f97e69e..0000000 --- a/mlt/src/tests/io.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * io.h -- dv1394d client demo input/output - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -#ifndef _DEMO_IO_H_ -#define _DEMO_IO_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern char *chomp( char * ); -extern char *trim( char * ); -extern char *strip_quotes( char * ); -extern char *get_string( char *, int, char * ); -extern int *get_int( int *, int ); -extern void term_init( ); -extern int term_read( ); -extern void term_exit( ); -extern char get_keypress( ); -extern void wait_for_any_key( char * ); -extern void beep( ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/tests/luma.c b/mlt/src/tests/luma.c deleted file mode 100644 index dabb878..0000000 --- a/mlt/src/tests/luma.c +++ /dev/null @@ -1,75 +0,0 @@ - -#include - -#include - -int main( int argc, char **argv ) -{ - char temp[ 132 ]; - char *file1 = NULL; - char *file2 = NULL; - char *wipe = NULL; - - mlt_factory_init( "../modules" ); - - if ( argc < 4 ) - { - fprintf( stderr, "usage: luma file1.mpeg file2.mpeg wipe.pgm\n" ); - return 1; - } - else - { - file1 = argv[ 1 ]; - file2 = argv[ 2 ]; - wipe = argv[ 3 ]; - } - - // Start the consumer... - mlt_consumer consumer = mlt_factory_consumer( "bluefish", "NTSC" ); - - // Create the producer(s) - mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 ); - mlt_producer dv2 = mlt_factory_producer( "mcmpeg", file2 ); - - mlt_playlist playlist1 = mlt_playlist_init(); - mlt_playlist_append_io( playlist1, dv1, 0.0, 5.0 ); - - mlt_playlist playlist2 = mlt_playlist_init(); - mlt_playlist_blank( playlist2, 2.9 ); - mlt_playlist_append( playlist2, dv2 ); - - // Register producers(s) with a multitrack object - mlt_multitrack multitrack = mlt_multitrack_init( ); - mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist1 ), 0 ); - mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist2 ), 1 ); - - // Define a transition - mlt_transition transition = mlt_factory_transition( "luma", wipe ); - mlt_properties_set( mlt_transition_properties( transition ), "filename", wipe ); - mlt_properties_set_double( mlt_transition_properties( transition ), "softness", 0.1 ); - mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 ); - mlt_transition_set_in_and_out( transition, 3.0, 5.0 ); - - // Buy a tractor and connect it to the filter - mlt_tractor tractor = mlt_tractor_init( ); - mlt_tractor_connect( tractor, mlt_transition_service( transition ) ); - - // Connect the tractor to the consumer - mlt_consumer_connect( consumer, mlt_tractor_service( tractor ) ); - - // Do stuff until we're told otherwise... - fprintf( stderr, "Press return to continue\n" ); - fgets( temp, 132, stdin ); - - // Close everything... - mlt_consumer_close( consumer ); - mlt_tractor_close( tractor ); - mlt_transition_close( transition ); - mlt_multitrack_close( multitrack ); - mlt_playlist_close( playlist1 ); - mlt_playlist_close( playlist2 ); - mlt_producer_close( dv1 ); - mlt_producer_close( dv2 ); - - return 0; -} diff --git a/mlt/src/tests/pango.c b/mlt/src/tests/pango.c deleted file mode 100644 index fb56113..0000000 --- a/mlt/src/tests/pango.c +++ /dev/null @@ -1,78 +0,0 @@ - -#include - -#include - -int main( int argc, char **argv ) -{ - char temp[ 132 ]; - char *file1 = NULL; - char *text = NULL; - - mlt_factory_init( "../modules" ); - - if ( argc < 3 ) - { - fprintf( stderr, "usage: pango file.mpeg text_to_display\n" ); - return 1; - } - else - { - file1 = argv[ 1 ]; - text = argv[ 2 ]; - } - - // Start the consumer... - mlt_consumer consumer = mlt_factory_consumer( "bluefish", "NTSC" ); - - // Create the producer(s) - mlt_playlist pl1 = mlt_playlist_init(); - mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 ); - mlt_playlist_append( pl1, dv1 ); - - mlt_playlist pl2 = mlt_playlist_init(); - mlt_producer title = mlt_factory_producer( "pango", NULL ); //"Mutton Lettuce Tomato" ); - mlt_playlist_append( pl2, title ); - mlt_properties_set_int( mlt_producer_properties( title ), "video_standard", mlt_video_standard_pal ); - mlt_properties_set( mlt_producer_properties( title ), "font", "Sans Bold 36" ); - mlt_properties_set( mlt_producer_properties( title ), "text", text ); - mlt_properties_set_int( mlt_producer_properties( title ), "bgcolor", 0x0000007f ); - mlt_properties_set_int( mlt_producer_properties( title ), "pad", 8 ); - mlt_properties_set_int( mlt_producer_properties( title ), "align", 1 ); - mlt_properties_set_int( mlt_producer_properties( title ), "x", 200 ); - mlt_properties_set_int( mlt_producer_properties( title ), "y", 40 ); - mlt_properties_set_double( mlt_producer_properties( title ), "mix", 0.8 ); - - // Register producers(s) with a multitrack object - mlt_multitrack multitrack = mlt_multitrack_init( ); - mlt_multitrack_connect( multitrack, mlt_playlist_producer( pl1 ), 0 ); - mlt_multitrack_connect( multitrack, mlt_playlist_producer( pl2 ), 1 ); - - // Define a transition - mlt_transition transition = mlt_factory_transition( "composite", NULL ); - mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 ); - mlt_transition_set_in_and_out( transition, 0.0, 9999.0 ); - - // Buy a tractor and connect it to the filter - mlt_tractor tractor = mlt_tractor_init( ); - mlt_tractor_connect( tractor, mlt_transition_service( transition ) ); - - // Connect the tractor to the consumer - mlt_consumer_connect( consumer, mlt_tractor_service( tractor ) ); - - // Do stuff until we're told otherwise... - fprintf( stderr, "Press return to continue\n" ); - fgets( temp, 132, stdin ); - - // Close everything... - mlt_consumer_close( consumer ); - mlt_tractor_close( tractor ); - mlt_transition_close( transition ); - mlt_multitrack_close( multitrack ); - mlt_playlist_close( pl1 ); - mlt_playlist_close( pl2 ); - mlt_producer_close( dv1 ); - mlt_producer_close( title ); - - return 0; -} diff --git a/mlt/src/tests/pixbuf.c b/mlt/src/tests/pixbuf.c deleted file mode 100644 index 64a23b7..0000000 --- a/mlt/src/tests/pixbuf.c +++ /dev/null @@ -1,73 +0,0 @@ - -#include - -#include - -int main( int argc, char **argv ) -{ - char temp[ 132 ]; - char *file1 = NULL; - char *file2 = NULL; - - mlt_factory_init( "../modules" ); - - if ( argc < 3 ) - { - fprintf( stderr, "usage: pixbuf file.mpeg file.{png,jpg,etc}\n" ); - return 1; - } - else - { - file1 = argv[ 1 ]; - file2 = argv[ 2 ]; - } - - // Start the consumer... - mlt_consumer consumer = mlt_factory_consumer( "sdl", "PAL" ); - - // Create the producer(s) - mlt_playlist pl1 = mlt_playlist_init(); - mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 ); - mlt_playlist_append( pl1, dv1 ); - - mlt_playlist pl2 = mlt_playlist_init(); - mlt_producer overlay = mlt_factory_producer( "pixbuf", file2 ); - mlt_playlist_append( pl2, overlay ); - mlt_properties_set_int( mlt_producer_properties( overlay ), "video_standard", mlt_video_standard_pal ); - mlt_properties_set_int( mlt_producer_properties( overlay ), "x", 600 ); - mlt_properties_set_int( mlt_producer_properties( overlay ), "y", 460 ); - mlt_properties_set_double( mlt_producer_properties( overlay ), "mix", 0.8 ); - - // Register producers(s) with a multitrack object - mlt_multitrack multitrack = mlt_multitrack_init( ); - mlt_multitrack_connect( multitrack, mlt_playlist_producer( pl1 ), 0 ); - mlt_multitrack_connect( multitrack, mlt_playlist_producer( pl2 ), 1 ); - - // Define a transition - mlt_transition transition = mlt_factory_transition( "composite", NULL ); - mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 ); - mlt_transition_set_in_and_out( transition, 0.0, 9999.0 ); - - // Buy a tractor and connect it to the filter - mlt_tractor tractor = mlt_tractor_init( ); - mlt_tractor_connect( tractor, mlt_transition_service( transition ) ); - - // Connect the tractor to the consumer - mlt_consumer_connect( consumer, mlt_tractor_service( tractor ) ); - - // Do stuff until we're told otherwise... - fprintf( stderr, "Press return to continue\n" ); - fgets( temp, 132, stdin ); - - // Close everything... - mlt_consumer_close( consumer ); - mlt_tractor_close( tractor ); - mlt_transition_close( transition ); - mlt_multitrack_close( multitrack ); - mlt_playlist_close( pl1 ); - mlt_playlist_close( pl2 ); - mlt_producer_close( dv1 ); - mlt_producer_close( overlay ); - - return 0; -} diff --git a/mlt/src/tests/setenv b/mlt/src/tests/setenv deleted file mode 100644 index 44cee49..0000000 --- a/mlt/src/tests/setenv +++ /dev/null @@ -1,7 +0,0 @@ -export MLT_REPOSITORY=`pwd`/../modules - -export LD_LIBRARY_PATH=`pwd`/../framework:\ -`pwd`/../modules/bluefish:\ -`pwd`/../../../bluefish/lib:\ -`pwd`/../../../mpeg_sdk_demo/bin:\ -`pwd`/../../../dv_sdk diff --git a/mlt/src/tests/test.png b/mlt/src/tests/test.png deleted file mode 100644 index b3fca64519876231ae9a060fc194a0ae48244fd8..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 1352 zc-jF-1-JT%P)Q2Ue;Z@vP-uW*q~F{#Qkvx3{iucMMBURf(ro( z64WDz%3wsI1WiZ?IwmqfE=>#|LBSY)C;}3QD2(82BPa;o3Yo5hZNR#99qZa2f1I_H ztzGq(@2_*d%lmxq_4@>AL{Ystz*E3%(8@tLfC8W$@PYO#i2cA(x63(@PM;VBR0zBZ zsDLq@BESzc0Gr${XE4` z1|ntJ0SGg&TT#7n-^VOm1LP#zVloOEUoK*PO)iZ~?3fIKZ+`3pz?LmDX}oDv8-aU) zg>j&wdadZGpWHfwAkV6w>%po_8W!8RaAkmwZr!a5X4uFyCr$Q5SsnWjit2q9*fZMd z9E-%}x?(0zFayy1bCC8MVV<6D1t1cIGrt5mcsjs$=YoX7S~4|NZkO}C?5JM08kjs9 zFcj7}?&(9Ruwb_tC@nHlV3Wzp&@Gb$l-iBdRA*89h+Zx?15rA=BZ+GM_Ia94Nx-DU z(X0%KbuZZY^sTXc{HBAN>MR7%+aKlCO;@>aMekmAo1O=n2FE>pM54M?)+~wIN386A z!@<`ZO3BHLyL%FV1ezl@Qc-H=;5*}ad`cE~jWtnOW@f!=XG>i%7PB-03LpgRJkrgK zm8~@Hzs_%eh2nF2kNN2eMq|GY&|??@B#T+_$(pf@D>UNoi*oREFSDj)W6PES@O6cG zzQISAKSH)eVoO3yTQ2rfx8)jxL$RwUH8HWo#NqD)3BJ?ZZddsf3AC#Ki)PvwS7_vV zPlQ>kTG{mZ3g)eCC{RK3XAoU0l3r}8U_Op9YZb^ z?EobOdXH}F3^OpOpR~&#;idQ5Is3;g0LqGtY+F%+HA@-+eW)sv4_+%Ctr4^j0XYY7 zvscfk`zD&Hz9%ETYG6=f>HAk{KCgF|3B^V}tSceIBt}3_pAVuXtq6#5WJmQffO&tm z3NmN96{A5=qhxd9Y#-eLJ>Zcj9P${1up%f)^|VT~g#0ouC4e0HKI z1xwRFEb)1o{1R{k=;`PVvwm+E02wC1j`|YH9k<(7IHFO%^%|`mg83iL;5+;<%SgDg_rhe<@N zjeW(caw9`Q-F)B%2Tu0h0Ud9@ed)`Ro)sFm@%;ckPgB@Yz03nV1IVX- z3Q~}3pt8)2#Vk?#s1;cf6pb= zFFs*IeR9kQEtgscSoCgtywFof2zc1-a<(K6j;NZUx5y5_3^1j_LjBx4${i-c5sh7k z{d{z&n{Z@QSSK*Y?Q)(RK9RIc71cWmv@b#AgWfOAMnO12IuO9Oz-+h6c{ADMXzx-P zSOlyB%F|JXKpPSh.depend - -dist-clean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/mlt/src/valerie/configure b/mlt/src/valerie/configure deleted file mode 100755 index 1a24852..0000000 --- a/mlt/src/valerie/configure +++ /dev/null @@ -1 +0,0 @@ -#!/bin/sh diff --git a/mlt/src/valerie/valerie.c b/mlt/src/valerie/valerie.c deleted file mode 100644 index f273153..0000000 --- a/mlt/src/valerie/valerie.c +++ /dev/null @@ -1,875 +0,0 @@ -/* - * valerie.c -- High Level Client API for miracle - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -/* System header files */ -#include -#include -#include -#include - -/* Application header files */ -#include "valerie.h" -#include "valerie_tokeniser.h" -#include "valerie_util.h" - -/** Initialise the valerie structure. -*/ - -valerie valerie_init( valerie_parser parser ) -{ - valerie this = malloc( sizeof( valerie_t ) ); - if ( this != NULL ) - { - memset( this, 0, sizeof( valerie_t ) ); - this->parser = parser; - } - return this; -} - -/** Set the response structure associated to the last command. -*/ - -static void valerie_set_last_response( valerie this, valerie_response response ) -{ - if ( this != NULL ) - { - if ( this->last_response != NULL ) - valerie_response_close( this->last_response ); - this->last_response = response; - } -} - -/** Connect to the parser. -*/ - -valerie_error_code valerie_connect( valerie this ) -{ - valerie_error_code error = valerie_server_unavailable; - valerie_response response = valerie_parser_connect( this->parser ); - if ( response != NULL ) - { - valerie_set_last_response( this, response ); - if ( valerie_response_get_error_code( response ) == 100 ) - error = valerie_ok; - } - return error; -} - -/** Interpret a non-context sensitive error code. -*/ - -static valerie_error_code valerie_get_error_code( valerie this, valerie_response response ) -{ - valerie_error_code error = valerie_server_unavailable; - switch( valerie_response_get_error_code( response ) ) - { - case -1: - error = valerie_server_unavailable; - break; - case -2: - error = valerie_no_response; - break; - case 200: - case 201: - case 202: - error = valerie_ok; - break; - case 400: - error = valerie_invalid_command; - break; - case 401: - error = valerie_server_timeout; - break; - case 402: - error = valerie_missing_argument; - break; - case 403: - error = valerie_unit_unavailable; - break; - case 404: - error = valerie_invalid_file; - break; - default: - case 500: - error = valerie_unknown_error; - break; - } - return error; -} - -/** Execute a command. -*/ - -valerie_error_code valerie_execute( valerie this, size_t size, char *format, ... ) -{ - valerie_error_code error = valerie_server_unavailable; - char *command = malloc( size ); - if ( this != NULL && command != NULL ) - { - va_list list; - va_start( list, format ); - if ( vsnprintf( command, size, format, list ) != 0 ) - { - valerie_response response = valerie_parser_execute( this->parser, command ); - valerie_set_last_response( this, response ); - error = valerie_get_error_code( this, response ); - } - else - { - error = valerie_invalid_command; - } - va_end( list ); - } - else - { - error = valerie_malloc_failed; - } - free( command ); - return error; -} - -/** Set a global property. -*/ - -valerie_error_code valerie_set( valerie this, char *property, char *value ) -{ - return valerie_execute( this, 1024, "SET %s=%s", property, value ); -} - -/** Get a global property. -*/ - -valerie_error_code valerie_get( valerie this, char *property, char *value, int length ) -{ - valerie_error_code error = valerie_execute( this, 1024, "GET %s", property ); - if ( error == valerie_ok ) - { - valerie_response response = valerie_get_last_response( this ); - strncpy( value, valerie_response_get_line( response, 1 ), length ); - } - return error; -} - -/** Run a script. -*/ - -valerie_error_code valerie_run( valerie this, char *file ) -{ - return valerie_execute( this, 10240, "RUN \"%s\"", file ); -} - -/** Add a unit. -*/ - -valerie_error_code valerie_unit_add( valerie this, char *guid, int *unit ) -{ - valerie_error_code error = valerie_execute( this, 1024, "UADD %s", guid ); - if ( error == valerie_ok ) - { - int length = valerie_response_count( this->last_response ); - char *line = valerie_response_get_line( this->last_response, length - 2 ); - if ( line == NULL || sscanf( line, "U%d", unit ) != 1 ) - error = valerie_unit_creation_failed; - } - else - { - if ( error == valerie_unknown_error ) - error = valerie_unit_creation_failed; - } - return error; -} - -/** Load a file on the specified unit. -*/ - -valerie_error_code valerie_unit_load( valerie this, int unit, char *file ) -{ - return valerie_execute( this, 10240, "LOAD U%d \"%s\"", unit, file ); -} - -static void valerie_interpret_clip_offset( char *output, valerie_clip_offset offset, int clip ) -{ - switch( offset ) - { - case valerie_absolute: - sprintf( output, "%d", clip ); - break; - case valerie_relative: - if ( clip < 0 ) - sprintf( output, "%d", clip ); - else - sprintf( output, "+%d", clip ); - break; - } -} - -/** Load a file on the specified unit with the specified in/out points. -*/ - -valerie_error_code valerie_unit_load_clipped( valerie this, int unit, char *file, int64_t in, int64_t out ) -{ - return valerie_execute( this, 10240, "LOAD U%d \"%s\" %lld %lld", unit, file, in, out ); -} - -/** Load a file on the specified unit at the end of the current pump. -*/ - -valerie_error_code valerie_unit_load_back( valerie this, int unit, char *file ) -{ - return valerie_execute( this, 10240, "LOAD U%d \"!%s\"", unit, file ); -} - -/** Load a file on the specified unit at the end of the pump with the specified in/out points. -*/ - -valerie_error_code valerie_unit_load_back_clipped( valerie this, int unit, char *file, int64_t in, int64_t out ) -{ - return valerie_execute( this, 10240, "LOAD U%d \"!%s\" %lld %lld", unit, file, in, out ); -} - -/** Append a file on the specified unit. -*/ - -valerie_error_code valerie_unit_append( valerie this, int unit, char *file, int64_t in, int64_t out ) -{ - return valerie_execute( this, 10240, "APND U%d \"%s\" %lld %lld", unit, file, in, out ); -} - -/** Clean the unit - this function removes all but the currently playing clip. -*/ - -valerie_error_code valerie_unit_clean( valerie this, int unit ) -{ - return valerie_execute( this, 1024, "CLEAN U%d", unit ); -} - -/** Move clips on the units playlist. -*/ - -valerie_error_code valerie_unit_clip_move( valerie this, int unit, valerie_clip_offset src_offset, int src, valerie_clip_offset dest_offset, int dest ) -{ - char temp1[ 100 ]; - char temp2[ 100 ]; - valerie_interpret_clip_offset( temp1, src_offset, src ); - valerie_interpret_clip_offset( temp2, dest_offset, dest ); - return valerie_execute( this, 1024, "MOVE U%d %s %s", unit, temp1, temp2 ); -} - -/** Remove clip at the specified position. -*/ - -valerie_error_code valerie_unit_clip_remove( valerie this, int unit, valerie_clip_offset offset, int clip ) -{ - char temp[ 100 ]; - valerie_interpret_clip_offset( temp, offset, clip ); - return valerie_execute( this, 1024, "REMOVE U%d %s", unit, temp ); -} - -/** Remove the currently playing clip. -*/ - -valerie_error_code valerie_unit_remove_current_clip( valerie this, int unit ) -{ - return valerie_execute( this, 1024, "REMOVE U%d", unit ); -} - -/** Insert clip at the specified position. -*/ - -valerie_error_code valerie_unit_clip_insert( valerie this, int unit, valerie_clip_offset offset, int clip, char *file, int64_t in, int64_t out ) -{ - char temp[ 100 ]; - valerie_interpret_clip_offset( temp, offset, clip ); - return valerie_execute( this, 1024, "INSERT U%d %s %s %lld %lld", unit, file, temp, in, out ); -} - -/** Play the unit at normal speed. -*/ - -valerie_error_code valerie_unit_play( valerie this, int unit ) -{ - return valerie_execute( this, 1024, "PLAY U%d 1000", unit ); -} - -/** Play the unit at specified speed. -*/ - -valerie_error_code valerie_unit_play_at_speed( valerie this, int unit, int speed ) -{ - return valerie_execute( this, 10240, "PLAY U%d %d", unit, speed ); -} - -/** Stop playback on the specified unit. -*/ - -valerie_error_code valerie_unit_stop( valerie this, int unit ) -{ - return valerie_execute( this, 1024, "STOP U%d", unit ); -} - -/** Pause playback on the specified unit. -*/ - -valerie_error_code valerie_unit_pause( valerie this, int unit ) -{ - return valerie_execute( this, 1024, "PAUSE U%d", unit ); -} - -/** Rewind the specified unit. -*/ - -valerie_error_code valerie_unit_rewind( valerie this, int unit ) -{ - return valerie_execute( this, 1024, "REW U%d", unit ); -} - -/** Fast forward the specified unit. -*/ - -valerie_error_code valerie_unit_fast_forward( valerie this, int unit ) -{ - return valerie_execute( this, 1024, "FF U%d", unit ); -} - -/** Step by the number of frames on the specified unit. -*/ - -valerie_error_code valerie_unit_step( valerie this, int unit, int64_t step ) -{ - return valerie_execute( this, 1024, "STEP U%d %lld", unit, step ); -} - -/** Goto the specified frame on the specified unit. -*/ - -valerie_error_code valerie_unit_goto( valerie this, int unit, int64_t position ) -{ - return valerie_execute( this, 1024, "GOTO U%d %lld", unit, position ); -} - -/** Goto the specified frame in the clip on the specified unit. -*/ - -valerie_error_code valerie_unit_clip_goto( valerie this, int unit, valerie_clip_offset offset, int clip, int64_t position ) -{ - char temp[ 100 ]; - valerie_interpret_clip_offset( temp, offset, clip ); - return valerie_execute( this, 1024, "GOTO U%d %lld %s", unit, position, temp ); -} - -/** Set the in point of the loaded file on the specified unit. -*/ - -valerie_error_code valerie_unit_set_in( valerie this, int unit, int64_t in ) -{ - return valerie_execute( this, 1024, "SIN U%d %lld", unit, in ); -} - -/** Set the in point of the clip on the specified unit. -*/ - -valerie_error_code valerie_unit_clip_set_in( valerie this, int unit, valerie_clip_offset offset, int clip, int64_t in ) -{ - char temp[ 100 ]; - valerie_interpret_clip_offset( temp, offset, clip ); - return valerie_execute( this, 1024, "SIN U%d %lld %s", unit, in, temp ); -} - -/** Set the out point of the loaded file on the specified unit. -*/ - -valerie_error_code valerie_unit_set_out( valerie this, int unit, int64_t out ) -{ - return valerie_execute( this, 1024, "SOUT U%d %lld", unit, out ); -} - -/** Set the out point of the clip on the specified unit. -*/ - -valerie_error_code valerie_unit_clip_set_out( valerie this, int unit, valerie_clip_offset offset, int clip, int64_t in ) -{ - char temp[ 100 ]; - valerie_interpret_clip_offset( temp, offset, clip ); - return valerie_execute( this, 1024, "SOUT U%d %lld %s", unit, in, temp ); -} - -/** Clear the in point of the loaded file on the specified unit. -*/ - -valerie_error_code valerie_unit_clear_in( valerie this, int unit ) -{ - return valerie_execute( this, 1024, "SIN U%d -1", unit ); -} - -/** Clear the out point of the loaded file on the specified unit. -*/ - -valerie_error_code valerie_unit_clear_out( valerie this, int unit ) -{ - return valerie_execute( this, 1024, "SOUT U%d -1", unit ); -} - -/** Clear the in and out points on the loaded file on the specified unit. -*/ - -valerie_error_code valerie_unit_clear_in_out( valerie this, int unit ) -{ - valerie_error_code error = valerie_unit_clear_out( this, unit ); - if ( error == valerie_ok ) - error = valerie_unit_clear_in( this, unit ); - return error; -} - -/** Set a unit configuration property. -*/ - -valerie_error_code valerie_unit_set( valerie this, int unit, char *name, char *value ) -{ - return valerie_execute( this, 1024, "USET U%d %s=%s", unit, name, value ); -} - -/** Get a unit configuration property. -*/ - -valerie_error_code valerie_unit_get( valerie this, int unit, char *name ) -{ - return valerie_execute( this, 1024, "UGET U%d %s", unit, name ); -} - -/** Get a units status. -*/ - -valerie_error_code valerie_unit_status( valerie this, int unit, valerie_status status ) -{ - valerie_error_code error = valerie_execute( this, 1024, "USTA U%d", unit ); - int error_code = valerie_response_get_error_code( this->last_response ); - - memset( status, 0, sizeof( valerie_status_t ) ); - status->unit = unit; - if ( error_code == 202 && valerie_response_count( this->last_response ) == 2 ) - valerie_status_parse( status, valerie_response_get_line( this->last_response, 1 ) ); - else if ( error_code == 403 ) - status->status = unit_undefined; - - return error; -} - -/** Transfer the current settings of unit src to unit dest. -*/ - -valerie_error_code valerie_unit_transfer( valerie this, int src, int dest ) -{ - return valerie_execute( this, 1024, "XFER U%d U%d", src, dest ); -} - -/** Obtain the parsers notifier. -*/ - -valerie_notifier valerie_get_notifier( valerie this ) -{ - if ( this != NULL ) - return valerie_parser_get_notifier( this->parser ); - else - return NULL; -} - -/** List the contents of the specified directory. -*/ - -valerie_dir valerie_dir_init( valerie this, char *directory ) -{ - valerie_dir dir = malloc( sizeof( valerie_dir_t ) ); - if ( dir != NULL ) - { - memset( dir, 0, sizeof( valerie_dir_t ) ); - dir->directory = strdup( directory ); - dir->response = valerie_parser_executef( this->parser, "CLS \"%s\"", directory ); - } - return dir; -} - -/** Return the error code associated to the dir. -*/ - -valerie_error_code valerie_dir_get_error_code( valerie_dir dir ) -{ - if ( dir != NULL ) - return valerie_get_error_code( NULL, dir->response ); - else - return valerie_malloc_failed; -} - -/** Get a particular file entry in the directory. -*/ - -valerie_error_code valerie_dir_get( valerie_dir dir, int index, valerie_dir_entry entry ) -{ - valerie_error_code error = valerie_ok; - memset( entry, 0, sizeof( valerie_dir_entry_t ) ); - if ( index < valerie_dir_count( dir ) ) - { - char *line = valerie_response_get_line( dir->response, index + 1 ); - valerie_tokeniser tokeniser = valerie_tokeniser_init( ); - valerie_tokeniser_parse_new( tokeniser, line, " " ); - - if ( valerie_tokeniser_count( tokeniser ) > 0 ) - { - valerie_util_strip( valerie_tokeniser_get_string( tokeniser, 0 ), '\"' ); - strcpy( entry->full, dir->directory ); - if ( entry->full[ strlen( entry->full ) - 1 ] != '/' ) - strcat( entry->full, "/" ); - strcpy( entry->name, valerie_tokeniser_get_string( tokeniser, 0 ) ); - strcat( entry->full, entry->name ); - - switch ( valerie_tokeniser_count( tokeniser ) ) - { - case 1: - entry->dir = 1; - break; - case 2: - entry->size = strtoull( valerie_tokeniser_get_string( tokeniser, 1 ), NULL, 10 ); - break; - default: - error = valerie_invalid_file; - break; - } - } - valerie_tokeniser_close( tokeniser ); - } - return error; -} - -/** Get the number of entries in the directory -*/ - -int valerie_dir_count( valerie_dir dir ) -{ - if ( dir != NULL && valerie_response_count( dir->response ) >= 2 ) - return valerie_response_count( dir->response ) - 2; - else - return -1; -} - -/** Close the directory structure. -*/ - -void valerie_dir_close( valerie_dir dir ) -{ - if ( dir != NULL ) - { - free( dir->directory ); - valerie_response_close( dir->response ); - free( dir ); - } -} - -/** List the playlist of the specified unit. -*/ - -valerie_list valerie_list_init( valerie this, int unit ) -{ - valerie_list list = calloc( 1, sizeof( valerie_list_t ) ); - if ( list != NULL ) - { - list->response = valerie_parser_executef( this->parser, "LIST U%d", unit ); - if ( valerie_response_count( list->response ) >= 2 ) - list->generation = atoi( valerie_response_get_line( list->response, 1 ) ); - } - return list; -} - -/** Return the error code associated to the list. -*/ - -valerie_error_code valerie_list_get_error_code( valerie_list list ) -{ - if ( list != NULL ) - return valerie_get_error_code( NULL, list->response ); - else - return valerie_malloc_failed; -} - -/** Get a particular file entry in the list. -*/ - -valerie_error_code valerie_list_get( valerie_list list, int index, valerie_list_entry entry ) -{ - valerie_error_code error = valerie_ok; - memset( entry, 0, sizeof( valerie_list_entry_t ) ); - if ( index < valerie_list_count( list ) ) - { - char *line = valerie_response_get_line( list->response, index + 2 ); - valerie_tokeniser tokeniser = valerie_tokeniser_init( ); - valerie_tokeniser_parse_new( tokeniser, line, " " ); - - if ( valerie_tokeniser_count( tokeniser ) > 0 ) - { - entry->clip = atoi( valerie_tokeniser_get_string( tokeniser, 0 ) ); - valerie_util_strip( valerie_tokeniser_get_string( tokeniser, 1 ), '\"' ); - strcpy( entry->full, valerie_tokeniser_get_string( tokeniser, 1 ) ); - entry->in = atol( valerie_tokeniser_get_string( tokeniser, 2 ) ); - entry->out = atol( valerie_tokeniser_get_string( tokeniser, 3 ) ); - entry->max = atol( valerie_tokeniser_get_string( tokeniser, 4 ) ); - entry->size = atol( valerie_tokeniser_get_string( tokeniser, 5 ) ); - entry->fps = atof( valerie_tokeniser_get_string( tokeniser, 6 ) ); - } - valerie_tokeniser_close( tokeniser ); - } - return error; -} - -/** Get the number of entries in the list -*/ - -int valerie_list_count( valerie_list list ) -{ - if ( list != NULL && valerie_response_count( list->response ) >= 3 ) - return valerie_response_count( list->response ) - 3; - else - return -1; -} - -/** Close the list structure. -*/ - -void valerie_list_close( valerie_list list ) -{ - if ( list != NULL ) - { - valerie_response_close( list->response ); - free( list ); - } -} - -/** List the currently connected nodes. -*/ - -valerie_nodes valerie_nodes_init( valerie this ) -{ - valerie_nodes nodes = malloc( sizeof( valerie_nodes_t ) ); - if ( nodes != NULL ) - { - memset( nodes, 0, sizeof( valerie_nodes_t ) ); - nodes->response = valerie_parser_executef( this->parser, "NLS" ); - } - return nodes; -} - -/** Return the error code associated to the nodes list. -*/ - -valerie_error_code valerie_nodes_get_error_code( valerie_nodes nodes ) -{ - if ( nodes != NULL ) - return valerie_get_error_code( NULL, nodes->response ); - else - return valerie_malloc_failed; -} - -/** Get a particular node entry. -*/ - -valerie_error_code valerie_nodes_get( valerie_nodes nodes, int index, valerie_node_entry entry ) -{ - valerie_error_code error = valerie_ok; - memset( entry, 0, sizeof( valerie_node_entry_t ) ); - if ( index < valerie_nodes_count( nodes ) ) - { - char *line = valerie_response_get_line( nodes->response, index + 1 ); - valerie_tokeniser tokeniser = valerie_tokeniser_init( ); - valerie_tokeniser_parse_new( tokeniser, line, " " ); - - if ( valerie_tokeniser_count( tokeniser ) == 3 ) - { - entry->node = atoi( valerie_tokeniser_get_string( tokeniser, 0 ) ); - strncpy( entry->guid, valerie_tokeniser_get_string( tokeniser, 1 ), sizeof( entry->guid ) ); - valerie_util_strip( valerie_tokeniser_get_string( tokeniser, 2 ), '\"' ); - strncpy( entry->name, valerie_tokeniser_get_string( tokeniser, 2 ), sizeof( entry->name ) ); - } - - valerie_tokeniser_close( tokeniser ); - } - return error; -} - -/** Get the number of nodes -*/ - -int valerie_nodes_count( valerie_nodes nodes ) -{ - if ( nodes != NULL && valerie_response_count( nodes->response ) >= 2 ) - return valerie_response_count( nodes->response ) - 2; - else - return -1; -} - -/** Close the nodes structure. -*/ - -void valerie_nodes_close( valerie_nodes nodes ) -{ - if ( nodes != NULL ) - { - valerie_response_close( nodes->response ); - free( nodes ); - } -} - -/** List the currently defined units. -*/ - -valerie_units valerie_units_init( valerie this ) -{ - valerie_units units = malloc( sizeof( valerie_units_t ) ); - if ( units != NULL ) - { - memset( units, 0, sizeof( valerie_units_t ) ); - units->response = valerie_parser_executef( this->parser, "ULS" ); - } - return units; -} - -/** Return the error code associated to the nodes list. -*/ - -valerie_error_code valerie_units_get_error_code( valerie_units units ) -{ - if ( units != NULL ) - return valerie_get_error_code( NULL, units->response ); - else - return valerie_malloc_failed; -} - -/** Get a particular unit entry. -*/ - -valerie_error_code valerie_units_get( valerie_units units, int index, valerie_unit_entry entry ) -{ - valerie_error_code error = valerie_ok; - memset( entry, 0, sizeof( valerie_unit_entry_t ) ); - if ( index < valerie_units_count( units ) ) - { - char *line = valerie_response_get_line( units->response, index + 1 ); - valerie_tokeniser tokeniser = valerie_tokeniser_init( ); - valerie_tokeniser_parse_new( tokeniser, line, " " ); - - if ( valerie_tokeniser_count( tokeniser ) == 4 ) - { - entry->unit = atoi( valerie_tokeniser_get_string( tokeniser, 0 ) + 1 ); - entry->node = atoi( valerie_tokeniser_get_string( tokeniser, 1 ) ); - strncpy( entry->guid, valerie_tokeniser_get_string( tokeniser, 2 ), sizeof( entry->guid ) ); - entry->online = atoi( valerie_tokeniser_get_string( tokeniser, 3 ) ); - } - - valerie_tokeniser_close( tokeniser ); - } - return error; -} - -/** Get the number of units -*/ - -int valerie_units_count( valerie_units units ) -{ - if ( units != NULL && valerie_response_count( units->response ) >= 2 ) - return valerie_response_count( units->response ) - 2; - else - return -1; -} - -/** Close the units structure. -*/ - -void valerie_units_close( valerie_units units ) -{ - if ( units != NULL ) - { - valerie_response_close( units->response ); - free( units ); - } -} - -/** Get the response of the last command executed. -*/ - -valerie_response valerie_get_last_response( valerie this ) -{ - return this->last_response; -} - -/** Obtain a printable message associated to the error code provided. -*/ - -char *valerie_error_description( valerie_error_code error ) -{ - char *msg = "Unrecognised error"; - switch( error ) - { - case valerie_ok: - msg = "OK"; - break; - case valerie_malloc_failed: - msg = "Memory allocation error"; - break; - case valerie_unknown_error: - msg = "Unknown error"; - break; - case valerie_no_response: - msg = "No response obtained"; - break; - case valerie_invalid_command: - msg = "Invalid command"; - break; - case valerie_server_timeout: - msg = "Communications with server timed out"; - break; - case valerie_missing_argument: - msg = "Missing argument"; - break; - case valerie_server_unavailable: - msg = "Unable to communicate with server"; - break; - case valerie_unit_creation_failed: - msg = "Unit creation failed"; - break; - case valerie_unit_unavailable: - msg = "Unit unavailable"; - break; - case valerie_invalid_file: - msg = "Invalid file"; - break; - case valerie_invalid_position: - msg = "Invalid position"; - break; - } - return msg; -} - -/** Close the valerie structure. -*/ - -void valerie_close( valerie this ) -{ - if ( this != NULL ) - { - valerie_set_last_response( this, NULL ); - free( this ); - } -} diff --git a/mlt/src/valerie/valerie.h b/mlt/src/valerie/valerie.h deleted file mode 100644 index 658ef9a..0000000 --- a/mlt/src/valerie/valerie.h +++ /dev/null @@ -1,256 +0,0 @@ -/* - * valerie.h -- High Level Client API for miracle - * Copyright (C) 2002-2003 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 program 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. - * - * 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. - */ - -#ifndef _VALERIE_H_ -#define _VALERIE_H_ - -/* System header files */ -#include - -/* Application header files */ -#include "valerie_parser.h" -#include "valerie_status.h" -#include "valerie_notifier.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Client error conditions -*/ - -typedef enum -{ - valerie_ok = 0, - valerie_malloc_failed, - valerie_unknown_error, - valerie_no_response, - valerie_invalid_command, - valerie_server_timeout, - valerie_missing_argument, - valerie_server_unavailable, - valerie_unit_creation_failed, - valerie_unit_unavailable, - valerie_invalid_file, - valerie_invalid_position -} -valerie_error_code; - -/** Clip index specification. -*/ - -typedef enum -{ - valerie_absolute = 0, - valerie_relative -} -valerie_clip_offset; - -/** Client structure. -*/ - -typedef struct -{ - valerie_parser parser; - valerie_response last_response; -} -*valerie, valerie_t; - -/** Client API. -*/ - -extern valerie valerie_init( valerie_parser ); - -/* Connect to the valerie parser instance */ -extern valerie_error_code valerie_connect( valerie ); - -/* Global functions */ -extern valerie_error_code valerie_set( valerie, char *, char * ); -extern valerie_error_code valerie_get( valerie, char *, char *, int ); -extern valerie_error_code valerie_run( valerie, char * ); - -/* Unit functions */ -extern valerie_error_code valerie_unit_add( valerie, char *, int * ); -extern valerie_error_code valerie_unit_load( valerie, int, char * ); -extern valerie_error_code valerie_unit_load_clipped( valerie, int, char *, int64_t, int64_t ); -extern valerie_error_code valerie_unit_load_back( valerie, int, char * ); -extern valerie_error_code valerie_unit_load_back_clipped( valerie, int, char *, int64_t, int64_t ); -extern valerie_error_code valerie_unit_append( valerie, int, char *, int64_t, int64_t ); -extern valerie_error_code valerie_unit_clean( valerie, int ); -extern valerie_error_code valerie_unit_clip_move( valerie, int, valerie_clip_offset, int, valerie_clip_offset, int ); -extern valerie_error_code valerie_unit_clip_remove( valerie, int, valerie_clip_offset, int ); -extern valerie_error_code valerie_unit_remove_current_clip( valerie, int ); -extern valerie_error_code valerie_unit_clip_insert( valerie, int, valerie_clip_offset, int, char *, int64_t, int64_t ); -extern valerie_error_code valerie_unit_play( valerie, int ); -extern valerie_error_code valerie_unit_play_at_speed( valerie, int, int ); -extern valerie_error_code valerie_unit_stop( valerie, int ); -extern valerie_error_code valerie_unit_pause( valerie, int ); -extern valerie_error_code valerie_unit_rewind( valerie, int ); -extern valerie_error_code valerie_unit_fast_forward( valerie, int ); -extern valerie_error_code valerie_unit_step( valerie, int, int64_t ); -extern valerie_error_code valerie_unit_goto( valerie, int, int64_t ); -extern valerie_error_code valerie_unit_clip_goto( valerie, int, valerie_clip_offset, int, int64_t ); -extern valerie_error_code valerie_unit_clip_set_in( valerie, int, valerie_clip_offset, int, int64_t ); -extern valerie_error_code valerie_unit_clip_set_out( valerie, int, valerie_clip_offset, int, int64_t ); -extern valerie_error_code valerie_unit_set_in( valerie, int, int64_t ); -extern valerie_error_code valerie_unit_set_out( valerie, int, int64_t ); -extern valerie_error_code valerie_unit_clear_in( valerie, int ); -extern valerie_error_code valerie_unit_clear_out( valerie, int ); -extern valerie_error_code valerie_unit_clear_in_out( valerie, int ); -extern valerie_error_code valerie_unit_set( valerie, int, char *, char * ); -extern valerie_error_code valerie_unit_get( valerie, int, char * ); -extern valerie_error_code valerie_unit_status( valerie, int, valerie_status ); -extern valerie_error_code valerie_unit_transfer( valerie, int, int ); - -/* Notifier functionality. */ -extern valerie_notifier valerie_get_notifier( valerie ); - -/** Structure for the directory. -*/ - -typedef struct -{ - char *directory; - valerie_response response; -} -*valerie_dir, valerie_dir_t; - -/** Directory entry structure. -*/ - -typedef struct -{ - int dir; - char name[ NAME_MAX ]; - char full[ PATH_MAX + NAME_MAX ]; - unsigned long long size; -} -*valerie_dir_entry, valerie_dir_entry_t; - -/* Directory reading. */ -extern valerie_dir valerie_dir_init( valerie, char * ); -extern valerie_error_code valerie_dir_get_error_code( valerie_dir ); -extern valerie_error_code valerie_dir_get( valerie_dir, int, valerie_dir_entry ); -extern int valerie_dir_count( valerie_dir ); -extern void valerie_dir_close( valerie_dir ); - -/** Structure for the list. -*/ - -typedef struct -{ - int generation; - valerie_response response; -} -*valerie_list, valerie_list_t; - -/** List entry structure. -*/ - -typedef struct -{ - int clip; - char full[ PATH_MAX + NAME_MAX ]; - int64_t in; - int64_t out; - int64_t max; - int64_t size; - int64_t fps; -} -*valerie_list_entry, valerie_list_entry_t; - -/* List reading. */ -extern valerie_list valerie_list_init( valerie, int ); -extern valerie_error_code valerie_list_get_error_code( valerie_list ); -extern valerie_error_code valerie_list_get( valerie_list, int, valerie_list_entry ); -extern int valerie_list_count( valerie_list ); -extern void valerie_list_close( valerie_list ); - -/** Structure for nodes. -*/ - -typedef struct -{ - valerie_response response; -} -*valerie_nodes, valerie_nodes_t; - -/** Node entry structure. -*/ - -typedef struct -{ - int node; - char guid[ 17 ]; - char name[ 1024 ]; -} -*valerie_node_entry, valerie_node_entry_t; - -/* Node reading. */ -extern valerie_nodes valerie_nodes_init( valerie ); -extern valerie_error_code valerie_nodes_get_error_code( valerie_nodes ); -extern valerie_error_code valerie_nodes_get( valerie_nodes, int, valerie_node_entry ); -extern int valerie_nodes_count( valerie_nodes ); -extern void valerie_nodes_close( valerie_nodes ); - -/** Structure for units. -*/ - -typedef struct -{ - valerie_response response; -} -*valerie_units, valerie_units_t; - -/** Unit entry structure. -*/ - -typedef struct -{ - int unit; - int node; - char guid[ 512 ]; - int online; -} -*valerie_unit_entry, valerie_unit_entry_t; - -/* Unit reading. */ -extern valerie_units valerie_units_init( valerie ); -extern valerie_error_code valerie_units_get_error_code( valerie_units ); -extern valerie_error_code valerie_units_get( valerie_units, int, valerie_unit_entry ); -extern int valerie_units_count( valerie_units ); -extern void valerie_units_close( valerie_units ); - -/* Miscellaenous functions */ -extern valerie_response valerie_get_last_response( valerie ); -extern char *valerie_error_description( valerie_error_code ); - -/* Courtesy functions. */ -extern valerie_error_code valerie_execute( valerie, size_t, char *, ... ); - -/* Close function. */ -extern void valerie_close( valerie ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/valerie/valerie_notifier.c b/mlt/src/valerie/valerie_notifier.c deleted file mode 100644 index 5e374a8..0000000 --- a/mlt/src/valerie/valerie_notifier.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - * valerie_notifier.c -- Unit Status Notifier Handling - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* System header files */ -#include -#include -#include -#include -#include - -/* Application header files */ -#include "valerie_notifier.h" - -/** Notifier initialisation. -*/ - -valerie_notifier valerie_notifier_init( ) -{ - valerie_notifier this = malloc( sizeof( valerie_notifier_t ) ); - if ( this != NULL ) - { - int index = 0; - memset( this, 0, sizeof( valerie_notifier_t ) ); - pthread_mutex_init( &this->mutex, NULL ); - pthread_cond_init( &this->cond, NULL ); - pthread_mutex_init( &this->cond_mutex, NULL ); - for ( index = 0; index < MAX_UNITS; index ++ ) - this->store[ index ].unit = index; - } - return this; -} - -/** Get a stored status for the specified unit. -*/ - -void valerie_notifier_get( valerie_notifier this, valerie_status status, int unit ) -{ - pthread_mutex_lock( &this->mutex ); - if ( unit >= 0 && unit < MAX_UNITS ) - { - valerie_status_copy( status, &this->store[ unit ] ); - } - else - { - memset( status, 0, sizeof( valerie_status_t ) ); - status->unit = unit; - } - status->dummy = time( NULL ); - pthread_mutex_unlock( &this->mutex ); -} - -/** Wait on a new status. -*/ - -int valerie_notifier_wait( valerie_notifier this, valerie_status status ) -{ - struct timeval now; - struct timespec timeout; - int error = 0; - - memset( status, 0, sizeof( valerie_status_t ) ); - - pthread_mutex_lock( &this->cond_mutex ); - gettimeofday( &now, NULL ); - timeout.tv_sec = now.tv_sec + 1; - timeout.tv_nsec = now.tv_usec * 1000; - if ( pthread_cond_timedwait( &this->cond, &this->cond_mutex, &timeout ) != ETIMEDOUT ) - { - pthread_mutex_lock( &this->mutex ); - valerie_status_copy( status, &this->last ); - pthread_mutex_unlock( &this->mutex ); - } - else - { - error = -1; - } - pthread_mutex_unlock( &this->cond_mutex ); - - return error; -} - -/** Put a new status. -*/ - -void valerie_notifier_put( valerie_notifier this, valerie_status status ) -{ - pthread_mutex_lock( &this->mutex ); - valerie_status_copy( &this->store[ status->unit ], status ); - valerie_status_copy( &this->last, status ); - pthread_mutex_unlock( &this->mutex ); - pthread_cond_broadcast( &this->cond ); -} - -/** Communicate a disconnected status for all units to all waiting. -*/ - -void valerie_notifier_disconnected( valerie_notifier notifier ) -{ - int unit = 0; - valerie_status_t status; - for ( unit = 0; unit < MAX_UNITS; unit ++ ) - { - valerie_notifier_get( notifier, &status, unit ); - status.status = unit_disconnected; - valerie_notifier_put( notifier, &status ); - } -} - -/** Close the notifier - note that all access must be stopped before we call this. -*/ - -void valerie_notifier_close( valerie_notifier this ) -{ - if ( this != NULL ) - { - pthread_mutex_destroy( &this->mutex ); - pthread_mutex_destroy( &this->cond_mutex ); - pthread_cond_destroy( &this->cond ); - free( this ); - } -} diff --git a/mlt/src/valerie/valerie_notifier.h b/mlt/src/valerie/valerie_notifier.h deleted file mode 100644 index bc123ed..0000000 --- a/mlt/src/valerie/valerie_notifier.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * valerie_notifier.h -- Unit Status Notifier Handling - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -#ifndef _VALERIE_NOTIFIER_H_ -#define _VALERIE_NOTIFIER_H_ - -/* System header files */ -#include - -/* Application header files */ -#include "valerie_status.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define MAX_UNITS 16 - -/** Status notifier definition. -*/ - -typedef struct -{ - pthread_mutex_t mutex; - pthread_mutex_t cond_mutex; - pthread_cond_t cond; - valerie_status_t last; - valerie_status_t store[ MAX_UNITS ]; -} -*valerie_notifier, valerie_notifier_t; - -extern valerie_notifier valerie_notifier_init( ); -extern void valerie_notifier_get( valerie_notifier, valerie_status, int ); -extern int valerie_notifier_wait( valerie_notifier, valerie_status ); -extern void valerie_notifier_put( valerie_notifier, valerie_status ); -extern void valerie_notifier_disconnected( valerie_notifier ); -extern void valerie_notifier_close( valerie_notifier ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/valerie/valerie_parser.c b/mlt/src/valerie/valerie_parser.c deleted file mode 100644 index 4ead1c0..0000000 --- a/mlt/src/valerie/valerie_parser.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * valerie_parser.c -- Valerie Parser for Miracle - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -/* System header files */ -#include -#include -#include -#include - -/* Application header files */ -#include "valerie_parser.h" -#include "valerie_util.h" - -/** Connect to the parser. -*/ - -valerie_response valerie_parser_connect( valerie_parser parser ) -{ - return parser->connect( parser->real ); -} - -/** Execute a command via the parser. -*/ - -valerie_response valerie_parser_execute( valerie_parser parser, char *command ) -{ - return parser->execute( parser->real, command ); -} - -/** Execute a formatted command via the parser. -*/ - -valerie_response valerie_parser_executef( valerie_parser parser, char *format, ... ) -{ - char *command = malloc( 10240 ); - valerie_response response = NULL; - if ( command != NULL ) - { - va_list list; - va_start( list, format ); - if ( vsnprintf( command, 10240, format, list ) != 0 ) - response = valerie_parser_execute( parser, command ); - va_end( list ); - free( command ); - } - return response; -} - -/** Execute the contents of a file. Note the special case valerie_response returned. -*/ - -valerie_response valerie_parser_run( valerie_parser parser, char *filename ) -{ - valerie_response response = valerie_response_init( ); - if ( response != NULL ) - { - FILE *file = fopen( filename, "r" ); - if ( file != NULL ) - { - char command[ 1024 ]; - valerie_response_set_error( response, 201, "OK" ); - while ( valerie_response_get_error_code( response ) == 201 && fgets( command, 1024, file ) ) - { - valerie_util_trim( valerie_util_chomp( command ) ); - if ( strcmp( command, "" ) && command[ 0 ] != '#' ) - { - valerie_response temp = NULL; - valerie_response_printf( response, 1024, "%s\n", command ); - temp = valerie_parser_execute( parser, command ); - if ( temp != NULL ) - { - int index = 0; - for ( index = 0; index < valerie_response_count( temp ); index ++ ) - valerie_response_printf( response, 10240, "%s\n", valerie_response_get_line( temp, index ) ); - valerie_response_close( temp ); - } - else - { - valerie_response_set_error( response, 500, "Batch execution failed" ); - } - } - } - fclose( file ); - } - else - { - valerie_response_set_error( response, 404, "File not found." ); - } - } - return response; -} - -/** Get the notifier associated to the parser. -*/ - -valerie_notifier valerie_parser_get_notifier( valerie_parser parser ) -{ - if ( parser->notifier == NULL ) - parser->notifier = valerie_notifier_init( ); - return parser->notifier; -} - -/** Close the parser. -*/ - -void valerie_parser_close( valerie_parser parser ) -{ - if ( parser != NULL ) - { - parser->close( parser->real ); - valerie_notifier_close( parser->notifier ); - free( parser ); - } -} diff --git a/mlt/src/valerie/valerie_parser.h b/mlt/src/valerie/valerie_parser.h deleted file mode 100644 index 71446d9..0000000 --- a/mlt/src/valerie/valerie_parser.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * valerie_parser.h -- Valerie Parser for Miracle Server - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -#ifndef _VALERIE_PARSER_H_ -#define _VALERIE_PARSER_H_ - -/* Application header files */ -#include "valerie_response.h" -#include "valerie_notifier.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Callbacks to define the parser. -*/ - -typedef valerie_response (*parser_connect)( void * ); -typedef valerie_response (*parser_execute)( void *, char * ); -typedef void (*parser_close)( void * ); - -/** Structure for the valerie parser. -*/ - -typedef struct -{ - parser_connect connect; - parser_execute execute; - parser_close close; - void *real; - valerie_notifier notifier; -} -*valerie_parser, valerie_parser_t; - -/** API for the parser - note that no constructor is defined here. -*/ - -extern valerie_response valerie_parser_connect( valerie_parser ); -extern valerie_response valerie_parser_execute( valerie_parser, char * ); -extern valerie_response valerie_parser_executef( valerie_parser, char *, ... ); -extern valerie_response valerie_parser_run( valerie_parser, char * ); -extern valerie_notifier valerie_parser_get_notifier( valerie_parser ); -extern void valerie_parser_close( valerie_parser ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/valerie/valerie_remote.c b/mlt/src/valerie/valerie_remote.c deleted file mode 100644 index 4b5023e..0000000 --- a/mlt/src/valerie/valerie_remote.c +++ /dev/null @@ -1,260 +0,0 @@ -/* - * valerie_remote.c -- Remote Parser - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -/* System header files */ -#include -#include -#include -#include -#include -#include - -/* Application header files */ -#include "valerie_remote.h" -#include "valerie_socket.h" -#include "valerie_tokeniser.h" -#include "valerie_util.h" - -/** Private valerie_remote structure. -*/ - -typedef struct -{ - int terminated; - char *server; - int port; - valerie_socket socket; - valerie_socket status; - pthread_t thread; - valerie_parser parser; - pthread_mutex_t mutex; - int connected; -} -*valerie_remote, valerie_remote_t; - -/** Forward declarations. -*/ - -static valerie_response valerie_remote_connect( valerie_remote ); -static valerie_response valerie_remote_execute( valerie_remote, char * ); -static void valerie_remote_close( valerie_remote ); -static int valerie_remote_read_response( valerie_socket, valerie_response ); - -/** DV Parser constructor. -*/ - -valerie_parser valerie_parser_init_remote( char *server, int port ) -{ - valerie_parser parser = malloc( sizeof( valerie_parser_t ) ); - valerie_remote remote = malloc( sizeof( valerie_remote_t ) ); - - if ( parser != NULL ) - { - memset( parser, 0, sizeof( valerie_parser_t ) ); - - parser->connect = (parser_connect)valerie_remote_connect; - parser->execute = (parser_execute)valerie_remote_execute; - parser->close = (parser_close)valerie_remote_close; - parser->real = remote; - - if ( remote != NULL ) - { - memset( remote, 0, sizeof( valerie_remote_t ) ); - remote->parser = parser; - remote->server = strdup( server ); - remote->port = port; - pthread_mutex_init( &remote->mutex, NULL ); - } - } - return parser; -} - -/** Thread for receiving and distributing the status information. -*/ - -static void *valerie_remote_status_thread( void *arg ) -{ - valerie_remote remote = arg; - char temp[ 10240 ]; - int length = 0; - int offset = 0; - valerie_tokeniser tokeniser = valerie_tokeniser_init( ); - valerie_notifier notifier = valerie_parser_get_notifier( remote->parser ); - valerie_status_t status; - int index = 0; - - valerie_socket_write_data( remote->status, "STATUS\r\n", 8 ); - - while ( !remote->terminated && - ( length = valerie_socket_read_data( remote->status, temp + offset, sizeof( temp ) ) ) >= 0 ) - { - if ( strchr( temp, '\n' ) == NULL ) - { - offset = length; - continue; - } - offset = 0; - valerie_tokeniser_parse_new( tokeniser, temp, "\n" ); - for ( index = 0; index < valerie_tokeniser_count( tokeniser ); index ++ ) - { - char *line = valerie_tokeniser_get_string( tokeniser, index ); - if ( line[ strlen( line ) - 1 ] == '\r' ) - { - valerie_util_chomp( line ); - valerie_status_parse( &status, line ); - valerie_notifier_put( notifier, &status ); - } - else - { - strcpy( temp, line ); - offset = strlen( temp ); - } - } - } - - valerie_notifier_disconnected( notifier ); - valerie_tokeniser_close( tokeniser ); - remote->terminated = 1; - - return NULL; -} - -/** Forward reference. -*/ - -static void valerie_remote_disconnect( valerie_remote remote ); - -/** Connect to the server. -*/ - -static valerie_response valerie_remote_connect( valerie_remote remote ) -{ - valerie_response response = NULL; - - valerie_remote_disconnect( remote ); - - if ( !remote->connected ) - { - signal( SIGPIPE, SIG_IGN ); - - remote->socket = valerie_socket_init( remote->server, remote->port ); - remote->status = valerie_socket_init( remote->server, remote->port ); - - if ( valerie_socket_connect( remote->socket ) == 0 ) - { - response = valerie_response_init( ); - valerie_remote_read_response( remote->socket, response ); - } - - if ( response != NULL && valerie_socket_connect( remote->status ) == 0 ) - { - valerie_response status_response = valerie_response_init( ); - valerie_remote_read_response( remote->status, status_response ); - if ( valerie_response_get_error_code( status_response ) == 100 ) - pthread_create( &remote->thread, NULL, valerie_remote_status_thread, remote ); - valerie_response_close( status_response ); - remote->connected = 1; - } - } - - return response; -} - -/** Execute the command. -*/ - -static valerie_response valerie_remote_execute( valerie_remote remote, char *command ) -{ - valerie_response response = NULL; - pthread_mutex_lock( &remote->mutex ); - if ( valerie_socket_write_data( remote->socket, command, strlen( command ) ) == strlen( command ) ) - { - response = valerie_response_init( ); - valerie_socket_write_data( remote->socket, "\r\n", 2 ); - valerie_remote_read_response( remote->socket, response ); - } - pthread_mutex_unlock( &remote->mutex ); - return response; -} - -/** Disconnect. -*/ - -static void valerie_remote_disconnect( valerie_remote remote ) -{ - if ( remote != NULL && remote->terminated ) - { - pthread_join( remote->thread, NULL ); - valerie_socket_close( remote->status ); - valerie_socket_close( remote->socket ); - remote->connected = 0; - remote->terminated = 0; - } -} - -/** Close the parser. -*/ - -static void valerie_remote_close( valerie_remote remote ) -{ - if ( remote != NULL ) - { - remote->terminated = 1; - valerie_remote_disconnect( remote ); - pthread_mutex_destroy( &remote->mutex ); - free( remote->server ); - free( remote ); - } -} - -/** Read response. -*/ - -static int valerie_remote_read_response( valerie_socket socket, valerie_response response ) -{ - char temp[ 10240 ]; - int length; - int terminated = 0; - - while ( !terminated && ( length = valerie_socket_read_data( socket, temp, 10240 ) ) >= 0 ) - { - int position = 0; - temp[ length ] = '\0'; - valerie_response_write( response, temp, length ); - position = valerie_response_count( response ) - 1; - if ( position < 0 || temp[ strlen( temp ) - 1 ] != '\n' ) - continue; - switch( valerie_response_get_error_code( response ) ) - { - case 201: - case 500: - terminated = !strcmp( valerie_response_get_line( response, position ), "" ); - break; - case 202: - terminated = valerie_response_count( response ) >= 2; - break; - default: - terminated = 1; - break; - } - } - - return 0; -} diff --git a/mlt/src/valerie/valerie_remote.h b/mlt/src/valerie/valerie_remote.h deleted file mode 100644 index 291184a..0000000 --- a/mlt/src/valerie/valerie_remote.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * valerie_remote.h -- Remote Parser - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -#ifndef _VALERIE_REMOTE_H_ -#define _VALERIE_REMOTE_H_ - -/* Application header files */ -#include "valerie_parser.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Remote parser API. -*/ - -extern valerie_parser valerie_parser_init_remote( char *, int ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/valerie/valerie_response.c b/mlt/src/valerie/valerie_response.c deleted file mode 100644 index 5b9491c..0000000 --- a/mlt/src/valerie/valerie_response.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - * valerie_response.c -- Response - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -/* System header files */ -#include -#include -#include -#include - -/* Application header files */ -#include "valerie_response.h" - -/** Construct a new dv response. -*/ - -valerie_response valerie_response_init( ) -{ - valerie_response response = malloc( sizeof( valerie_response_t ) ); - if ( response != NULL ) - memset( response, 0, sizeof( valerie_response_t ) ); - return response; -} - -/** Clone a dv response -*/ - -valerie_response valerie_response_clone( valerie_response response ) -{ - valerie_response clone = valerie_response_init( ); - if ( clone != NULL && response != NULL ) - { - int index = 0; - for ( index = 0; index < valerie_response_count( response ); index ++ ) - { - char *line = valerie_response_get_line( response, index ); - valerie_response_printf( clone, strlen( line ) + 2, "%s\n", line ); - } - } - return clone; -} - -/** Get the error code associated to the response. -*/ - -int valerie_response_get_error_code( valerie_response response ) -{ - int error_code = -1; - if ( response != NULL ) - { - if ( response->count > 0 ) - { - if ( sscanf( response->array[ 0 ], "%d", &error_code ) != 1 ) - error_code = 0; - } - else - { - error_code = -2; - } - } - return error_code; -} - -/** Get the error description associated to the response. -*/ - -char *valerie_response_get_error_string( valerie_response response ) -{ - char *error_string = "No message specified"; - if ( response->count > 0 ) - { - char *ptr = strchr( response->array[ 0 ], ' ' ) ; - if ( ptr != NULL ) - error_string = ptr + 1; - } - return error_string; -} - -/** Get a line of text at the given index. Note that the text itself is - terminated only with a NUL char and it is the responsibility of the - the user of the returned data to use a LF or CR/LF as appropriate. -*/ - -char *valerie_response_get_line( valerie_response response, int index ) -{ - if ( index < response->count ) - return response->array[ index ]; - else - return NULL; -} - -/** Return the number of lines of text in the response. -*/ - -int valerie_response_count( valerie_response response ) -{ - if ( response != NULL ) - return response->count; - else - return 0; -} - -/** Set the error and description associated to the response. -*/ - -void valerie_response_set_error( valerie_response response, int error_code, char *error_string ) -{ - if ( response->count == 0 ) - { - valerie_response_printf( response, 10240, "%d %s\n", error_code, error_string ); - } - else - { - char temp[ 10240 ]; - int length = sprintf( temp, "%d %s", error_code, error_string ); - response->array[ 0 ] = realloc( response->array[ 0 ], length + 1 ); - strcpy( response->array[ 0 ], temp ); - } -} - -/** Write formatted text to the response. -*/ - -int valerie_response_printf( valerie_response response, size_t size, char *format, ... ) -{ - int length = 0; - char *text = malloc( size ); - if ( text != NULL ) - { - va_list list; - va_start( list, format ); - length = vsnprintf( text, size, format, list ); - if ( length != 0 ) - valerie_response_write( response, text, length ); - va_end( list ); - free( text ); - } - return length; -} - -/** Write text to the reponse. -*/ - -int valerie_response_write( valerie_response response, char *text, int size ) -{ - int ret = 0; - char *ptr = text; - - while ( size > 0 ) - { - int index = response->count - 1; - char *lf = strchr( ptr, '\n' ); - int length_of_string = 0; - - /* Make sure we have space in the dynamic array. */ - if ( !response->append && response->count >= response->size - 1 ) - { - response->size += 50; - response->array = realloc( response->array, response->size * sizeof( char * ) ); - } - - /* Make sure the array is valid, or we're really in trouble */ - if ( response->array == NULL ) - { - ret = 0; - break; - } - - /* Now, if we're appending to the previous write (ie: if it wasn't - terminated by a LF), then use the index calculated above, otherwise - go to the next one and ensure it's NULLed. */ - - if ( !response->append ) - { - response->array[ ++ index ] = NULL; - response->count ++; - } - else - { - length_of_string = strlen( response->array[ index ] ); - } - - /* Now we need to know how to handle the current ptr with respect to lf. */ - /* TODO: tidy up and error check... sigh... tested for many, many 1000s of lines */ - - if ( lf == NULL ) - { - response->array[ index ] = realloc( response->array[ index ], length_of_string + size + 1 ); - memcpy( response->array[ index ] + length_of_string, ptr, size ); - response->array[ index ][ length_of_string + size ] = '\0'; - if ( ( length_of_string + size ) > 0 && response->array[ index ][ length_of_string + size - 1 ] == '\r' ) - response->array[ index ][ length_of_string + size - 1 ] = '\0'; - size = 0; - ret += size; - response->append = 1; - } - else - { - int chars = lf - ptr; - response->array[ index ] = realloc( response->array[ index ], length_of_string + chars + 1 ); - memcpy( response->array[ index ] + length_of_string, ptr, chars ); - response->array[ index ][ length_of_string + chars ] = '\0'; - if ( ( length_of_string + chars ) > 0 && response->array[ index ][ length_of_string + chars - 1 ] == '\r' ) - response->array[ index ][ length_of_string + chars - 1 ] = '\0'; - ptr = ptr + chars + 1; - size -= ( chars + 1 ); - response->append = 0; - ret += chars + 1; - } - } - - return ret; -} - -/** Close the response. -*/ - -void valerie_response_close( valerie_response response ) -{ - if ( response != NULL ) - { - int index = 0; - for ( index = 0; index < response->count; index ++ ) - free( response->array[ index ] ); - free( response->array ); - free( response ); - } -} diff --git a/mlt/src/valerie/valerie_response.h b/mlt/src/valerie/valerie_response.h deleted file mode 100644 index 1e8f1fa..0000000 --- a/mlt/src/valerie/valerie_response.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * valerie_response.h -- Response - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -#ifndef _VALERIE_RESPONSE_H_ -#define _VALERIE_RESPONSE_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Structure for the response -*/ - -typedef struct -{ - char **array; - int size; - int count; - int append; -} -*valerie_response, valerie_response_t; - -/** API for accessing the response structure. -*/ - -extern valerie_response valerie_response_init( ); -extern valerie_response valerie_response_clone( valerie_response ); -extern int valerie_response_get_error_code( valerie_response ); -extern char *valerie_response_get_error_string( valerie_response ); -extern char *valerie_response_get_line( valerie_response, int ); -extern int valerie_response_count( valerie_response ); -extern void valerie_response_set_error( valerie_response, int, char * ); -extern int valerie_response_printf( valerie_response, size_t, char *, ... ); -extern int valerie_response_write( valerie_response, char *, int ); -extern void valerie_response_close( valerie_response ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/valerie/valerie_socket.c b/mlt/src/valerie/valerie_socket.c deleted file mode 100644 index 74e8483..0000000 --- a/mlt/src/valerie/valerie_socket.c +++ /dev/null @@ -1,175 +0,0 @@ -/* - * valerie_socket.c -- Client Socket - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* System header files */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Application header files */ -#include "valerie_socket.h" - -/** Initialise the socket. -*/ - -valerie_socket valerie_socket_init( char *server, int port ) -{ - valerie_socket socket = malloc( sizeof( valerie_socket_t ) ); - if ( socket != NULL ) - { - memset( socket, 0, sizeof( valerie_socket_t ) ); - socket->fd = -1; - socket->server = strdup( server ); - socket->port = port; - } - return socket; -} - -/** Connect to the server. -*/ - -int valerie_socket_connect( valerie_socket connection ) -{ - int ret = 0; - struct hostent *host; - struct sockaddr_in sock; - - if ( connection->server != NULL ) - { - host = gethostbyname( connection->server ); - - memset( &sock, 0, sizeof( struct sockaddr_in ) ); - memcpy( &sock.sin_addr, host->h_addr, host->h_length ); - sock.sin_family = host->h_addrtype; - sock.sin_port = htons( connection->port ); - - if ( ( connection->fd = socket( AF_INET, SOCK_STREAM, 0 ) ) != -1 ) - ret = connect( connection->fd, (const struct sockaddr *)&sock, sizeof( struct sockaddr_in ) ); - else - ret = -1; - } - - return ret; -} - -/** Convenience constructor for a connected file descriptor. -*/ - -valerie_socket valerie_socket_init_fd( int fd ) -{ - valerie_socket socket = malloc( sizeof( valerie_socket_t ) ); - if ( socket != NULL ) - { - memset( socket, 0, sizeof( valerie_socket_t ) ); - socket->fd = fd; - socket->no_close = 1; - } - return socket; -} - -/** Read an arbitrarily formatted block of data from the server. -*/ - -int valerie_socket_read_data( valerie_socket socket, char *data, int length ) -{ - struct timeval tv = { 1, 0 }; - fd_set rfds; - int used = 0; - - data[ 0 ] = '\0'; - - FD_ZERO( &rfds ); - FD_SET( socket->fd, &rfds ); - - if ( select( socket->fd + 1, &rfds, NULL, NULL, &tv ) ) - { - used = read( socket->fd, data, length - 1 ); - if ( used > 0 ) - data[ used ] = '\0'; - else - used = -1; - } - - return used; -} - -/** Write an arbitrarily formatted block of data to the server. -*/ - -int valerie_socket_write_data( valerie_socket socket, char *data, int length ) -{ - int used = 0; - - while ( used >=0 && used < length ) - { - struct timeval tv = { 1, 0 }; - fd_set rfds; - fd_set wfds; - fd_set efds; - - FD_ZERO( &rfds ); - FD_SET( socket->fd, &rfds ); - FD_ZERO( &wfds ); - FD_SET( socket->fd, &wfds ); - FD_ZERO( &efds ); - FD_SET( socket->fd, &efds ); - - errno = 0; - - if ( select( socket->fd + 1, &rfds, &wfds, &efds, &tv ) ) - { - if ( errno != 0 || FD_ISSET( socket->fd, &efds ) || FD_ISSET( socket->fd, &rfds ) ) - { - used = -1; - } - else if ( FD_ISSET( socket->fd, &wfds ) ) - { - int inc = write( socket->fd, data + used, length - used ); - if ( inc > 0 ) - used += inc; - else - used = -1; - } - } - } - - return used; -} - -/** Close the socket. -*/ - -void valerie_socket_close( valerie_socket socket ) -{ - if ( socket->fd > 0 && !socket->no_close ) - close( socket->fd ); - free( socket->server ); - free( socket ); -} diff --git a/mlt/src/valerie/valerie_socket.h b/mlt/src/valerie/valerie_socket.h deleted file mode 100644 index f016ca1..0000000 --- a/mlt/src/valerie/valerie_socket.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * valerie_socket.h -- Client Socket - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _VALERIE_SOCKET_H_ -#define _VALERIE_SOCKET_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Structure for socket. -*/ - -typedef struct -{ - char *server; - int port; - int fd; - int no_close; -} -*valerie_socket, valerie_socket_t; - -/** Remote parser API. -*/ - -extern valerie_socket valerie_socket_init( char *, int ); -extern int valerie_socket_connect( valerie_socket ); -extern valerie_socket valerie_socket_init_fd( int ); -extern int valerie_socket_read_data( valerie_socket, char *, int ); -extern int valerie_socket_write_data( valerie_socket, char *, int ); -extern void valerie_socket_close( valerie_socket ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/valerie/valerie_status.c b/mlt/src/valerie/valerie_status.c deleted file mode 100644 index 5e4cbd2..0000000 --- a/mlt/src/valerie/valerie_status.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - * valerie_status.c -- Unit Status Handling - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -/* System header files */ -#include -#include -#include - -/* Application header files */ -#include "valerie_status.h" -#include "valerie_tokeniser.h" -#include "valerie_util.h" - -/** Parse a unit status string. -*/ - -void valerie_status_parse( valerie_status status, char *text ) -{ - valerie_tokeniser tokeniser = valerie_tokeniser_init( ); - if ( valerie_tokeniser_parse_new( tokeniser, text, " " ) == 17 ) - { - status->unit = atoi( valerie_tokeniser_get_string( tokeniser, 0 ) ); - strncpy( status->clip, valerie_util_strip( valerie_tokeniser_get_string( tokeniser, 2 ), '\"' ), sizeof( status->clip ) ); - status->position = atol( valerie_tokeniser_get_string( tokeniser, 3 ) ); - status->speed = atoi( valerie_tokeniser_get_string( tokeniser, 4 ) ); - status->fps = atof( valerie_tokeniser_get_string( tokeniser, 5 ) ); - status->in = atol( valerie_tokeniser_get_string( tokeniser, 6 ) ); - status->out = atol( valerie_tokeniser_get_string( tokeniser, 7 ) ); - status->length = atol( valerie_tokeniser_get_string( tokeniser, 8 ) ); - - strncpy( status->tail_clip, valerie_util_strip( valerie_tokeniser_get_string( tokeniser, 9 ), '\"' ), sizeof( status->tail_clip ) ); - status->tail_position = atol( valerie_tokeniser_get_string( tokeniser, 10 ) ); - status->tail_in = atol( valerie_tokeniser_get_string( tokeniser, 11 ) ); - status->tail_out = atol( valerie_tokeniser_get_string( tokeniser, 12 ) ); - status->tail_length = atol( valerie_tokeniser_get_string( tokeniser, 13 ) ); - status->seek_flag = atoi( valerie_tokeniser_get_string( tokeniser, 14 ) ); - status->generation = atoi( valerie_tokeniser_get_string( tokeniser, 15 ) ); - status->clip_index = atoi( valerie_tokeniser_get_string( tokeniser, 16 ) ); - - if ( !strcmp( valerie_tokeniser_get_string( tokeniser, 1 ), "unknown" ) ) - status->status = unit_unknown; - else if ( !strcmp( valerie_tokeniser_get_string( tokeniser, 1 ), "undefined" ) ) - status->status = unit_undefined; - else if ( !strcmp( valerie_tokeniser_get_string( tokeniser, 1 ), "offline" ) ) - status->status = unit_offline; - else if ( !strcmp( valerie_tokeniser_get_string( tokeniser, 1 ), "not_loaded" ) ) - status->status = unit_not_loaded; - else if ( !strcmp( valerie_tokeniser_get_string( tokeniser, 1 ), "stopped" ) ) - status->status = unit_stopped; - else if ( !strcmp( valerie_tokeniser_get_string( tokeniser, 1 ), "paused" ) ) - status->status = unit_paused; - else if ( !strcmp( valerie_tokeniser_get_string( tokeniser, 1 ), "playing" ) ) - status->status = unit_playing; - else if ( !strcmp( valerie_tokeniser_get_string( tokeniser, 1 ), "disconnected" ) ) - status->status = unit_disconnected; - } - else - { - memset( status, 0, sizeof( valerie_status_t ) ); - fprintf( stderr, "Status thread changed?\n" ); - } - valerie_tokeniser_close( tokeniser ); -} - -/** Serialise a status into a string. -*/ - -char *valerie_status_serialise( valerie_status status, char *text, int length ) -{ - char *status_string = NULL; - - switch( status->status ) - { - case unit_undefined: - status_string = "undefined"; - break; - - case unit_offline: - status_string = "offline"; - break; - - case unit_not_loaded: - status_string = "not_loaded"; - break; - - case unit_stopped: - status_string = "stopped"; - break; - - case unit_playing: - status_string = "playing"; - break; - - case unit_unknown: - status_string = "unknown"; - break; - - case unit_paused: - status_string = "paused"; - break; - - case unit_disconnected: - status_string = "disconnected"; - break; - } - - snprintf( text, length, "%d %s \"%s\" %lld %d %.2f %lld %lld %lld \"%s\" %lld %lld %lld %lld %d %d %d\r\n", - status->unit, - status_string, - status->clip, - status->position, - status->speed, - status->fps, - status->in, - status->out, - status->length, - status->tail_clip, - status->tail_position, - status->tail_in, - status->tail_out, - status->tail_length, - status->seek_flag, - status->generation, - status->clip_index ); - - return text; -} - -/** Compare two status codes for changes. -*/ - -int valerie_status_compare( valerie_status status1, valerie_status status2 ) -{ - return memcmp( status1, status2, sizeof( valerie_status_t ) ); -} - -/** Copy status code info from dest to src. -*/ - -valerie_status valerie_status_copy( valerie_status dest, valerie_status src ) -{ - return memcpy( dest, src, sizeof( valerie_status_t ) ); -} diff --git a/mlt/src/valerie/valerie_status.h b/mlt/src/valerie/valerie_status.h deleted file mode 100644 index 5da7497..0000000 --- a/mlt/src/valerie/valerie_status.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * valerie_status.h -- Unit Status Handling - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -#ifndef _VALERIE_STATUS_H_ -#define _VALERIE_STATUS_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Status codes -*/ - -typedef enum -{ - unit_unknown = 0, - unit_undefined, - unit_offline, - unit_not_loaded, - unit_stopped, - unit_playing, - unit_paused, - unit_disconnected -} -unit_status; - -/** Status structure. -*/ - -typedef struct -{ - int unit; - unit_status status; - char clip[ 2048 ]; - int64_t position; - int speed; - double fps; - int64_t in; - int64_t out; - int64_t length; - char tail_clip[ 2048 ]; - int64_t tail_position; - int64_t tail_in; - int64_t tail_out; - int64_t tail_length; - int seek_flag; - int generation; - int clip_index; - int dummy; -} -*valerie_status, valerie_status_t; - -/** DV1394 Status API -*/ - -extern void valerie_status_parse( valerie_status, char * ); -extern char *valerie_status_serialise( valerie_status, char *, int ); -extern int valerie_status_compare( valerie_status, valerie_status ); -extern valerie_status valerie_status_copy( valerie_status, valerie_status ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/valerie/valerie_tokeniser.c b/mlt/src/valerie/valerie_tokeniser.c deleted file mode 100644 index 7acaf85..0000000 --- a/mlt/src/valerie/valerie_tokeniser.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - * valerie_tokeniser.c -- String tokeniser - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -/* System header files */ -#include -#include - -/* Application header files */ -#include "valerie_tokeniser.h" - -/** Initialise a tokeniser. -*/ - -valerie_tokeniser valerie_tokeniser_init( ) -{ - valerie_tokeniser tokeniser = malloc( sizeof( valerie_tokeniser_t ) ); - if ( tokeniser != NULL ) - memset( tokeniser, 0, sizeof( valerie_tokeniser_t ) ); - return tokeniser; -} - -/** Clear the tokeniser. -*/ - -static void valerie_tokeniser_clear( valerie_tokeniser tokeniser ) -{ - int index = 0; - for ( index = 0; index < tokeniser->count; index ++ ) - free( tokeniser->tokens[ index ] ); - tokeniser->count = 0; - free( tokeniser->input ); - tokeniser->input = NULL; -} - -/** Append a string to the tokeniser. -*/ - -static int valerie_tokeniser_append( valerie_tokeniser tokeniser, char *token ) -{ - int error = 0; - - if ( tokeniser->count == tokeniser->size ) - { - tokeniser->size += 20; - tokeniser->tokens = realloc( tokeniser->tokens, tokeniser->size * sizeof( char * ) ); - } - - if ( tokeniser->tokens != NULL ) - { - tokeniser->tokens[ tokeniser->count ++ ] = strdup( token ); - } - else - { - tokeniser->count = 0; - error = -1; - } - return error; -} - -/** Parse a string by splitting on the delimiter provided. -*/ - -int valerie_tokeniser_parse_new( valerie_tokeniser tokeniser, char *string, char *delimiter ) -{ - int count = 0; - int length = strlen( string ); - int delimiter_size = strlen( delimiter ); - int index = 0; - char *token = strdup( string ); - - valerie_tokeniser_clear( tokeniser ); - tokeniser->input = strdup( string ); - strcpy( token, "" ); - - for ( index = 0; index < length; ) - { - char *start = string + index; - char *end = strstr( start, delimiter ); - - if ( end == NULL ) - { - strcat( token, start ); - valerie_tokeniser_append( tokeniser, token ); - index = length; - count ++; - } - else if ( start != end ) - { - strncat( token, start, end - start ); - index += end - start; - if ( token[ 0 ] != '\"' || ( token[ 0 ] == '\"' && token[ strlen( token ) - 1 ] == '\"' ) ) - { - valerie_tokeniser_append( tokeniser, token ); - strcpy( token, "" ); - count ++; - } - else while ( strncmp( string + index, delimiter, delimiter_size ) == 0 ) - { - strncat( token, delimiter, delimiter_size ); - index += delimiter_size; - } - } - else - { - index += strlen( delimiter ); - } - } - - /* Special case - malformed string condition */ - if ( !strcmp( token, "" ) ) - { - count = 0 - ( count - 1 ); - valerie_tokeniser_append( tokeniser, token ); - } - - free( token ); - return count; -} - -/** Get the original input. -*/ - -char *valerie_tokeniser_get_input( valerie_tokeniser tokeniser ) -{ - return tokeniser->input; -} - -/** Get the number of tokens. -*/ - -int valerie_tokeniser_count( valerie_tokeniser tokeniser ) -{ - return tokeniser->count; -} - -/** Get a token as a string. -*/ - -char *valerie_tokeniser_get_string( valerie_tokeniser tokeniser, int index ) -{ - if ( index < tokeniser->count ) - return tokeniser->tokens[ index ]; - else - return NULL; -} - -/** Close the tokeniser. -*/ - -void valerie_tokeniser_close( valerie_tokeniser tokeniser ) -{ - valerie_tokeniser_clear( tokeniser ); - free( tokeniser->tokens ); - free( tokeniser ); -} diff --git a/mlt/src/valerie/valerie_tokeniser.h b/mlt/src/valerie/valerie_tokeniser.h deleted file mode 100644 index 9d0838c..0000000 --- a/mlt/src/valerie/valerie_tokeniser.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * valerie_tokeniser.h -- String tokeniser - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -#ifndef _VALERIE_TOKENISER_H_ -#define _VALERIE_TOKENISER_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Structure for tokeniser. -*/ - -typedef struct -{ - char *input; - char **tokens; - int count; - int size; -} -*valerie_tokeniser, valerie_tokeniser_t; - -/** Remote parser API. -*/ - -extern valerie_tokeniser valerie_tokeniser_init( ); -extern int valerie_tokeniser_parse_new( valerie_tokeniser, char *, char * ); -extern char *valerie_tokeniser_get_input( valerie_tokeniser ); -extern int valerie_tokeniser_count( valerie_tokeniser ); -extern char *valerie_tokeniser_get_string( valerie_tokeniser, int ); -extern void valerie_tokeniser_close( valerie_tokeniser ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mlt/src/valerie/valerie_util.c b/mlt/src/valerie/valerie_util.c deleted file mode 100644 index 168f6a7..0000000 --- a/mlt/src/valerie/valerie_util.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * valerie_util.c -- General Purpose Client Utilities - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -/* System header files */ -#include -#include - -/* Application header files */ -#include "valerie_util.h" - -/** Remove LF or CR/LF terminations from the input string. -*/ - -char *valerie_util_chomp( char *input ) -{ - if ( input != NULL ) - { - int length = strlen( input ); - if ( length && input[ length - 1 ] == '\n' ) - input[ length - 1 ] = '\0'; - if ( length > 1 && input[ length - 2 ] == '\r' ) - input[ length - 2 ] = '\0'; - } - return input; -} - -/** Remove leading and trailing spaces from the input string. -*/ - -char *valerie_util_trim( char *input ) -{ - if ( input != NULL ) - { - int length = strlen( input ); - int first = 0; - while( first < length && isspace( input[ first ] ) ) - first ++; - memmove( input, input + first, length - first + 1 ); - length = length - first; - while ( length > 0 && isspace( input[ length - 1 ] ) ) - input[ -- length ] = '\0'; - } - return input; -} - -/** Strip the specified string of leading and trailing 'value' (ie: "). -*/ - -char *valerie_util_strip( char *input, char value ) -{ - if ( input != NULL ) - { - char *ptr = strrchr( input, value ); - if ( ptr != NULL ) - *ptr = '\0'; - if ( input[ 0 ] == value ) - strcpy( input, input + 1 ); - } - return input; -} diff --git a/mlt/src/valerie/valerie_util.h b/mlt/src/valerie/valerie_util.h deleted file mode 100644 index 492eba0..0000000 --- a/mlt/src/valerie/valerie_util.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * valerie_util.h -- General Purpose Client Utilities - * Copyright (C) 2002-2003 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 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 - * Lesser General Public License for more details. - * - * 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 - */ - -#ifndef _VALERIE_UTIL_H_ -#define _VALERIE_UTIL_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern char *valerie_util_chomp( char * ); -extern char *valerie_util_trim( char * ); -extern char *valerie_util_strip( char *, char ); - -#ifdef __cplusplus -} -#endif - -#endif -- 1.7.4.4