source: git/src/moviemaker.h @ f55cbeb

RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernlogstereowalls-datawalls-data-hanging-as-warning v1.2.28
Last change on this file since f55cbeb was 0aaa578, checked in by Olly Betts <olly@…>, 8 years ago

Overhaul movie export for current FFmpeg API

The code in moviemaker.cc now only handles the current API, and I've
split out moviemaker-legacy.cc for older versions - once those versions
are all obsolete, we can just remove that file.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1//
2//  moviemaker.h
3//
4//  Class for writing movies from Aven.
5//
6//  Copyright (C) 2004,2010,2011,2013,2014,2016 Olly Betts
7//
8//  This program is free software; you can redistribute it and/or modify
9//  it under the terms of the GNU General Public License as published by
10//  the Free Software Foundation; either version 2 of the License, or
11//  (at your option) any later version.
12//
13//  This program is distributed in the hope that it will be useful,
14//  but WITHOUT ANY WARRANTY; without even the implied warranty of
15//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16//  GNU General Public License for more details.
17//
18//  You should have received a copy of the GNU General Public License
19//  along with this program; if not, write to the Free Software
20//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21//
22
23#ifndef PACKAGE
24# error config.h must be included first in each C++ source file
25#endif
26
27#include <stdio.h>
28
29struct AVCodecContext;
30struct AVFormatContext;
31struct AVStream;
32struct AVFrame;
33struct AVPicture;
34struct SwsContext;
35
36class MovieMaker {
37#ifdef WITH_LIBAV
38    AVFormatContext *oc;
39    AVStream *video_st;
40# ifndef HAVE_AVCODEC_ENCODE_VIDEO2
41    int out_size; // Legacy-only.
42# endif
43    AVCodecContext *context;
44    AVFrame *frame;
45    unsigned char *outbuf; // Legacy-only.
46# ifndef HAVE_AVCODEC_ENCODE_VIDEO2
47    AVPicture *out; // Legacy-only.
48# endif
49    unsigned char *pixels;
50    SwsContext *sws_ctx;
51    int averrno;
52    FILE* fh_to_close;
53
54    int encode_frame(AVFrame* frame);
55    void release();
56#endif
57
58public:
59    MovieMaker();
60    bool Open(FILE* fh, const char* ext, int width, int height);
61    unsigned char * GetBuffer() const;
62    int GetWidth() const;
63    int GetHeight() const;
64    bool AddFrame();
65    bool Close();
66    ~MovieMaker();
67    const char * get_error_string() const;
68};
Note: See TracBrowser for help on using the repository browser.