OTQT Logo  

Video Plugin Howto


 
OpenQuicktime
 Home
 News
 F.A.Q.
 Codecs
 Download
 API Reference
 Test Movies
 Mailing Lists
 The Logo
 Links
-
 Project Page
 Bug Tracker
 Feature Requests
 ViewVC
 Perl Module

Please note that this howto is outdated now and needs revisised. It does not explain the new codec registration system

Generic Overview

Plugin for OpenQuicktime are dynamic libraries. They are automatically loaded and used by OpenQuicktime, and especially by the plugin.c file. A plugin corresponds in theorie to a single codec and a single fourcc (the four letters used to differentiate for example VBR MP3 audio - ".mp3" - from 3ivx video - "3IV1". To be found automatically, your new plugin should respect the OpenQuicktime plugin naming scheme: for a generic fourcc, oqt_codec_fourcc.so and should be placed in a directory parsed by your linker (you may have to modify you LD_LIBRARY_PATH environment variable).

Audio Plugin

Sorry, I’ve got no time to explain in detail the audio plugin mechanism but you could always start by looking at the plugins in the CVS.

Video Plugin

The best way to explain how to build a video plugin is to look into an example. This one has been extracted directly from the 3ivx video plugin ....

	#include "openquicktime/openquicktime.h"
	#include "openquicktime/colormodels.h"
	#include "openquicktime/private.h"

  /* Encoding function
  file : the current quicktime file
  track : the track number corresponding 
    to this video in the quicktime file
  
  input : the input raw video data. This 
    pointer is char** to allow different color model.
  output : the compressed video output
  IsAKeyFrame : 1 if this frame is a key 
    frame 0 otherwise
  return value : the output buffer size.
  */
  int encode_FOURCC(oqt_t *file, int track, unsigned char 
    **input, unsigned char *output, int *IsAKeyFrame) {
  }
  
  /* Cleaning function 
  Place all the memory desallocation here
  vtrack : a pointer on the quicktime video 
    track structure.
  return value : 1 if OK 0 otherwise.
  */ 
  int delete_FOURCC(oqt_video_map_t *vtrack) { 
  }
   
  /* Decoding function 
  file : the current quicktime file
  track : the track number corresponding 
    to this video in the quicktime file
  
  inputsize : the size of the input compressed 
    data buffer.
  
  input : the input compressed video data.
  output : the raw video output
  return value : the output buffer size.
  
  */
   int decode_FOURCC(oqt_t *file, int track, unsigned long 
    inputsize, unsigned char *input, unsigned char **output) {
  }
  
  /* Init function, called when the codec 
    is initialized. Place here all the global allocation
  vtrack : a pointer on the quicktime video 
    track structure.
  */
   
  void init_FOURCC(oqt_video_map_t *vtrack) { 
  }
  
  /* Test if the colormodel is supported 
    by the decoding part of the codec
  file : the current quicktime file
  track : the track number corresponding 
    to this video in the quicktime file
  
  colormodel : the colormodel we want to 
    test (see colormodel.h).
  
  return value : 1 if supported, 0 otherwise..
  
  */
  int reads_colormodel_FOURCC(oqt_t *file, int colormodel, 
    int track) { 
   }
  
  /* Test if the colormodel is supported 
    by the encoding part of the codec
  file : the current quicktime file
  track : the track number corresponding 
    to this video in the quicktime file
  
  colormodel : the colormodel we want to 
    test (see colormodel.h).
  
  return value : 1 if supported, 0 otherwise..
  
  */
  
  int writes_colormodel_FOURCC(oqt_t *file, int colormodel, 
    int track) { 
  } 

   /* Registering function, called when 
    the codec is loaded. The name of this function is obligatory this one.
  return value : 1 if OK, 0 otherwise
  */
  int oqt_codec_register(oqt_extern_video_t *codec) 
    { 

	strcpy(codec->fourcc,"XXXX"); 
	codec->init = init_FOURCC; 
	codec->encode = encode_FOURCC; 
	codec->decode = decode_FOURCC; 
	codec->delete_codec = delete_FOURCC; 
	codec->reads_colormodel = reads_colormodel_FOURCC; 
	codec->writes_colormodel = writes_colormodel_FOURCC; 
	}
	


  SourceForge Badge
Copyright: ©2001-2017 OpenQuicktime Team.
Last Modified: 31 August 2008 19:11:55 UTC.
Supported by: SourceForge, Electronics and Computer Science.
OpenQuicktime Badge