/
avi_videoencoder_vfw.h
57 lines (47 loc) · 1.97 KB
/
avi_videoencoder_vfw.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* kkapture: intrusive demo video capturing.
* Copyright (c) 2005-2010 Fabian "ryg/farbrausch" Giesen.
*
* This program is free software; you can redistribute and/or modify it under
* the terms of the Artistic License, Version 2.0beta5, or (at your opinion)
* any later version; all distributions of this program should contain this
* license in a file named "LICENSE.txt".
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT UNLESS REQUIRED BY
* LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER OR CONTRIBUTOR
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#ifndef __AVI_VIDEOENCODER_VFW_H__
#define __AVI_VIDEOENCODER_VFW_H__
#include "videoencoder.h"
class AVIVideoEncoderVFW : public VideoEncoder
{
struct Internal;
int xRes,yRes;
int frame;
int audioSample,audioBytesSample;
int fpsNum,fpsDenom;
Internal *d;
void Init();
void Cleanup();
void StartEncode();
void StartAudioEncode();
public:
AVIVideoEncoderVFW(const char *name,int fpsNum,int fpsDenom,unsigned long codec,unsigned int quality);
virtual ~AVIVideoEncoderVFW();
virtual void SetSize(int xRes,int yRes);
virtual void WriteFrame(const unsigned char *buffer);
virtual void SetAudioFormat(const tWAVEFORMATEX *fmt);
virtual tWAVEFORMATEX *GetAudioFormat();
virtual void WriteAudioFrame(const void *buffer,int samples);
};
#endif