1
/***************************************************************************
2
adm_encxvid.cpp - description
4
Encoder for Xvid 1.0x (dev-api4)
5
begin : Sun Jul 14 2002
6
copyright : (C) 2002/2003 by mean
7
email : fixounet@free.fr
8
***************************************************************************/
10
/***************************************************************************
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
17
***************************************************************************/
31
#include "ADM_toolkit/toolkit.hxx"
32
#include <ADM_assert.h>
34
#include "ADM_encoder/ADM_vidEncode.hxx"
36
#include "ADM_video/ADM_genvideo.hxx"
37
#include "ADM_encoder/adm_encoder.h"
38
#include "ADM_encoder/adm_encyv12.h"
41
#define aprintf printf
43
/*_________________________________________________*/
44
EncoderYV12::EncoderYV12 (void)
49
EncoderYV12::~EncoderYV12 ()
55
//--------------------------------
57
EncoderYV12::configure (AVDMGenericVideoStream * instream)
59
ADM_assert (instream);
63
info = instream->getInfo ();
66
_frametogo = info->nb_frames;
67
_vbuffer = new ADMImage (_w, _h);
68
ADM_assert (_vbuffer);
69
printf ("\n Yv12 Encoder ready , w: %lu h:%lu mode:%d", _w, _h, _state);
73
//______________________________
75
EncoderYV12::encode (uint32_t frame, ADMBitstream *out)
81
if (!_in->getFrameNumberNoAlloc (frame, &l, _vbuffer, &f))
83
printf ("\n Error : Cannot read incoming frame !");
86
l = (_w * _h * 3) >> 1;
88
out->flags = AVI_KEY_FRAME;
89
memcpy (out->data, _vbuffer->data, l);
93
//_______________________________
94
uint8_t EncoderYV12::stop (void)