-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodec_context.h
More file actions
38 lines (29 loc) · 911 Bytes
/
codec_context.h
File metadata and controls
38 lines (29 loc) · 911 Bytes
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
#pragma once
#include <stdexcept>
extern "C"
{
#include <libavcodec/avcodec.h>
}
class CodecContext final
{
CodecContext(const CodecContext&) = delete;
const CodecContext& operator=(const CodecContext&) = delete;
CodecContext(CodecContext&&) = delete;
const CodecContext& operator=(CodecContext&&) = delete;
public:
CodecContext();
~CodecContext();
/*
void CopyContext(AVCodecContext* codec_context) throw (std::logic_error, std::runtime_error);
void OpenCodec() throw (std::logic_error, std::runtime_error);
*/
void OpenCodec(AVCodecContext* codec_context_orig) throw (std::logic_error, std::runtime_error);
AVCodecContext* operator->() const noexcept
{ return _codec_context; }
operator AVCodecContext*() const noexcept
{ return _codec_context; }
operator bool() const noexcept { return _codec_context != NULL; }
private:
AVCodecContext* _codec_context;
AVCodec* _codec;
};