Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
06-27-2003, 01:47 PM
#1
Member
Registered: Jan 2003
Location: Venezuela
Distribution: Debian, Ubuntu
Posts: 75
Rep:
DivX.com Codecs and Xine
I downloaded and installed the lastest version of Xine. I installed also the Divx4linux actual version.
Now, How can I use DivX.com codecs with Xine???
I know i have Divx compabilty on Xine through ffmpeg codecs, but I just want to give a try to DivX.com codecs.
Radicalm16
06-27-2003, 06:57 PM
#2
Member
Registered: Jun 2003
Location: Netherlands
Distribution: Red Hat Linux 9, FreeBSD 4.8, Knoppix 3.2
Posts: 182
Rep:
Hmmm.. difficult. Your favorite Linux media player must have support for (read: reverse enginered) those specific Win32 codecs.
(
Although, maybe you want to go with the 'Win32 codecs' :
http://www.mplayerhq.hu/homepage/design6/dload.html
Download the .bz2 files and uncompress in your preffered path.
Recompile xine with "--with-w32-path=path".
)
06-27-2003, 07:11 PM
#3
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
you don't use divx.com... both xine and mplayer (which is much much better) use ffmpeg to play divx files, and it's performance easily outstrips the "official" codecs.
01-27-2009, 06:01 AM
#4
LQ Newbie
Registered: Jan 2009
Posts: 1
Rep:
DivX 6.1.1 codec for Linux developers divx.com/DivXLinuxCodec
Code:
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#define LOG_MODULE "divx_decoder"
#define LOG_VERBOSE
/*
#define LOG
*/
#include "xine_internal.h"
#include "video_out.h"
#include "buffer.h"
#include "LibQDec.h"
typedef struct {
long biSize;
long biWidth;
long biHeight;
short biPlanes;
short biBitCount;
long biCompression;
long biSizeImage;
long biXPelsPerMeter;
long biYPelsPerMeter;
long biClrUsed;
long biClrImportant;
} BITMAPINFOHEADER;
typedef struct {
video_decoder_class_t decoder_class;
} divx_class_t;
typedef struct divxdec_decoder_s {
video_decoder_t video_decoder;
xine_stream_t *stream;
divx_class_t *class;
BITMAPINFOHEADER bih;
int video_step;
int decoder_ok;
int size;
int bufsize;
long biWidth;
long biHeight;
unsigned char *buf;
void *pHandle;
LibQDecoreFunction *pDecore;
} divxdec_decoder_t;
#define VIDEOBUFSIZE 128*1024
static unsigned long str2ulong(void *data) {
unsigned char *str = data;
return ( str[0] | (str[1]<<8) | (str[2]<<16) | (str[3]<<24) );
}
static int divxdec_init (divxdec_decoder_t *this, buf_element_t *buf) {
DecInit decInit;
memset(&decInit, 0, sizeof(DecInit));
memcpy ( &this->bih, buf->content, sizeof (BITMAPINFOHEADER));
this->biWidth = str2ulong(&this->bih.biWidth);
this->biHeight = str2ulong(&this->bih.biHeight);
this->video_step = buf->decoder_info[1];
decInit.formatIn.width=this->biWidth;
decInit.formatIn.height=this->biHeight;
decInit.formatIn.fourCC=str2ulong("DX50");
decInit.formatOut.width=this->biWidth;
decInit.formatOut.height=this->biHeight;
decInit.formatOut.fourCC=str2ulong("YV12");
this->pDecore=getDecore(decInit.formatIn.fourCC);
if(this->pDecore(NULL, DEC_OPT_INIT, (void*) &this->pHandle, &decInit)!=DEC_OK){
return 0;
}
return 1;
}
static void divxdec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
DecFrame decFrame;
vo_frame_t *img;
divxdec_decoder_t *this = (divxdec_decoder_t *) this_gen;
if (buf->decoder_flags & BUF_FLAG_PREVIEW)
return;
if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */
this->decoder_ok = divxdec_init (this, buf);
if (this->decoder_ok) {
if( this->buf )
free( this->buf );
this->buf = malloc( VIDEOBUFSIZE );
this->bufsize = VIDEOBUFSIZE;
}
return;
}
if (!this->decoder_ok) {
return;
}
memset(&decFrame, 0, sizeof(DecFrame));
if( this->size + buf->size > this->bufsize ) {
this->bufsize = this->size + 2 * buf->size;
this->buf = realloc( this->buf, this->bufsize );
}
xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
this->size += buf->size;
if (buf->decoder_flags & BUF_FLAG_FRAMERATE)
this->video_step = buf->decoder_info[0];
if (buf->decoder_flags & BUF_FLAG_FRAME_END) { /* need to decode a frame */
img = this->stream->video_out->get_frame (this->stream->video_out,
this->biWidth,
this->biHeight,
(double)this->biWidth/(double)this->biHeight,
XINE_IMGFMT_YV12,
VO_BOTH_FIELDS);
img->pts = buf->pts;
img->duration = this->video_step;
decFrame.bitstream.iLength=this->size;
decFrame.bitstream.pBuff=this->buf;
decFrame.pBmp=img->base[0];
if(this->pDecore(this->pHandle,DEC_OPT_FRAME,&decFrame,0)!=DEC_OK) {
img->bad_frame = 1;
}
if(decFrame.frameWasDecoded) {
img->bad_frame = img->draw(img,this->stream);
}
img->free(img);
this->size = 0;
}
}
static void divxdec_flush (video_decoder_t *this_gen) {
}
static void divxdec_reset (video_decoder_t *this_gen) {
}
static void divxdec_discontinuity (video_decoder_t *this_gen) {
}
static void divxdec_dispose (video_decoder_t *this_gen) {
divxdec_decoder_t *this = (divxdec_decoder_t *) this_gen;
if(this->pDecore(this->pHandle, DEC_OPT_RELEASE, 0, 0)!=DEC_OK) {
this->decoder_ok = 0;
}
this->stream->video_out->close(this->stream->video_out, this->stream);
free (this);
}
static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
divxdec_decoder_t *this ;
this = (divxdec_decoder_t *) calloc(1, sizeof(divxdec_decoder_t));
this->video_decoder.decode_data = divxdec_decode_data;
this->video_decoder.flush = divxdec_flush;
this->video_decoder.reset = divxdec_reset;
this->video_decoder.discontinuity = divxdec_discontinuity;
this->video_decoder.dispose = divxdec_dispose;
this->stream = stream;
this->class = (divx_class_t *) class_gen;
this->decoder_ok = 0;
this->size = 0;
this->pHandle = NULL;
(stream->video_out->open) (stream->video_out, stream);
return &this->video_decoder;
}
/*
* divx plugin class
*/
static char *get_identifier (video_decoder_class_t *this) {
return "divxdec";
}
static char *get_description (video_decoder_class_t *this) {
return "divx based video decoder plugin";
}
static void dispose_class (video_decoder_class_t *this) {
free (this);
}
static void *init_plugin (xine_t *xine, void *data) {
divx_class_t *this;
this = (divx_class_t *) calloc(1, sizeof(divx_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
this->decoder_class.get_description = get_description;
this->decoder_class.dispose = dispose_class;
return this;
}
/*
* exported plugin catalog entry
*/
static uint32_t supported_types[] = {
BUF_VIDEO_DIVX5,
BUF_VIDEO_XVID,
0 };
static const decoder_info_t dec_info_divx = {
supported_types, /* supported types */
7 /* priority */
};
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
{ PLUGIN_VIDEO_DECODER, 18, "divx", XINE_VERSION_CODE, &dec_info_divx, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
All times are GMT -5. The time now is 09:27 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News