~ubuntu-branches/ubuntu/intrepid/transcode/intrepid-proposed

« back to all changes in this revision

Viewing changes to export/export_divx5raw.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2005-10-10 19:12:47 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051010191247-uq4j6t947df71v7m
Tags: 2:1.0.1-0.0ubuntu1
* New upstream release.
* debian/:
  + Remove 03_rescale.c and 04_average.c dpatches, applied upstream.
  + Force amd64 to link against the correct _pic libs, fixing FTBFS.
  + Disable mjpegtools support on ppc until post-Breezy (FTBFS).

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 *  This module is derived from export_divx4raw.c, minor modification by
13
13
 *  Lo�c Le Loarer <lll_tr@m4x.org>
14
14
 *  
15
 
 *  This file is part of transcode, a linux video stream processing tool
 
15
 *  This file is part of transcode, a video stream processing tool
16
16
 *      
17
17
 *  transcode is free software; you can redistribute it and/or modify
18
18
 *  it under the terms of the GNU General Public License as published by
49
49
#include <dlfcn.h>
50
50
#else
51
51
# ifdef SYSTEM_DARWIN
52
 
#  include "../libdldarwin/dlfcn.h"
 
52
#  include "libdldarwin/dlfcn.h"
53
53
# endif
54
54
#endif
55
55
 
58
58
#include "avilib.h"
59
59
#include "aud_aux.h"
60
60
#include "vbr.h"
 
61
#include "ioaux.h"
61
62
 
62
63
#define MOD_NAME    "export_divx5raw.so"
63
64
#define MOD_VERSION "v0.3.6 (2003-07-24)"
64
65
#define MOD_CODEC   "(video) DivX 5.xx (ES) | (audio) MPEG/AC3/PCM"
65
66
 
 
67
static int verbose_flag=TC_QUIET;
 
68
static int capability_flag=TC_CAP_PCM|TC_CAP_RGB|TC_CAP_YUV|TC_CAP_AC3|TC_CAP_AUD;
 
69
 
66
70
#define MOD_PRE divx5raw
67
71
#include "export_def.h"
68
72
 
73
77
  
74
78
//temporary audio/video buffer
75
79
static char *buffer;
76
 
#define BUFFER_SIZE SIZE_RGB_FRAME<<1
77
80
 
78
81
ENC_PARAM   *divx;
79
82
ENC_FRAME  encode;
80
83
ENC_RESULT    key;
81
84
 
82
 
static int verbose_flag=TC_QUIET;
83
 
static int capability_flag=TC_CAP_PCM|TC_CAP_RGB|TC_CAP_YUV|TC_CAP_AC3|TC_CAP_AUD;
84
 
 
85
85
// dl stuff
86
86
static int (*divx5_encore)(void *para0, int opt, void *para1, void *para2);
87
87
static void *handle;
89
89
 
90
90
#define MODULE "libdivxencore.so"
91
91
 
 
92
#if 0  /* get this from ioaux.c */
92
93
static int p_write (int fd, char *buf, size_t len)
93
94
{
94
95
   size_t n = 0;
103
104
   }
104
105
   return r;
105
106
}
 
107
#endif
106
108
 
107
109
 
108
110
static int divx5_init(char *path) {
109
 
#if defined(__FreeBSD__) || defined(__APPLE__) /* Just in case ProjectMayo will release FreeBSD library :-) */  
 
111
#ifdef SYS_BSD /* Just in case ProjectMayo will release FreeBSD library :-) */  
110
112
  const
111
113
#endif  
112
114
  char *error;
113
115
  int *quiet_encore;
 
116
 
 
117
        fprintf(stderr, "[%s] *** Warning: DivX is broken and support for it is ***\n", MOD_NAME);
 
118
        fprintf(stderr, "[%s] *** obsolete in transcode. Sooner or later it  ***\n", MOD_NAME);
 
119
        fprintf(stderr, "[%s] *** will be removed from transcode. Don't use ***\n", MOD_NAME);
 
120
        fprintf(stderr, "[%s] *** DivX. Use xvid or ffmpeg -F mpeg4 instead ***\n", MOD_NAME);
 
121
        fprintf(stderr, "[%s] *** for all your mpeg4 encodings. ***\n", MOD_NAME);
114
122
  
115
 
  sprintf(module, "%s/%s", path, MODULE);
 
123
  snprintf(module, sizeof(module), "%s/%s", path, MODULE);
116
124
  
117
125
  // try transcode's module directory
118
126
  
195
203
      }
196
204
    }
197
205
    
198
 
    if ((buffer = malloc(BUFFER_SIZE))==NULL) {
 
206
    if ((buffer = malloc(vob->ex_v_height*vob->ex_v_width*3))==NULL) {
199
207
      perror("out of memory");
200
208
      return(TC_EXPORT_ERROR); 
201
209
    } else
202
 
      memset(buffer, 0, BUFFER_SIZE);  
 
210
      memset(buffer, 0, vob->ex_v_height*vob->ex_v_width*3);  
203
211
 
204
212
    //load the codec
205
213