AvTranscoder  0.9.4
C++APIforLibav/FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AudioCodec.cpp
Go to the documentation of this file.
1 #include "AudioCodec.hpp"
2 
3 #include <cmath>
4 #include <cassert>
5 
6 namespace avtranscoder
7 {
8 
9 AudioCodec::AudioCodec(const ECodecType type, const std::string& codecName)
10  : ICodec(type, codecName)
11 {
12 }
13 
14 AudioCodec::AudioCodec(const ECodecType type, const AVCodecID codecId)
15  : ICodec(type, codecId)
16 {
17 }
18 
19 AudioCodec::AudioCodec(const ECodecType type, AVCodecContext& avCodecContext)
20  : ICodec(type, avCodecContext)
21 {
22 }
23 
25 {
26  assert(_avCodecContext != NULL);
27  return AudioFrameDesc(_avCodecContext->sample_rate, _avCodecContext->channels, _avCodecContext->sample_fmt);
28 }
29 
31 {
32  _avCodecContext->sample_rate = audioFrameDesc._sampleRate;
33  _avCodecContext->channels = audioFrameDesc._nbChannels;
34  _avCodecContext->sample_fmt = audioFrameDesc._sampleFormat;
35 }
36 }
#define AVCodecID
Definition: common.hpp:45
AVCodecContext * _avCodecContext
Full codec instance description (has ownership)
Definition: ICodec.hpp:66
AudioCodec(const ECodecType type, const std::string &codecName="")
Definition: AudioCodec.cpp:9
AVSampleFormat _sampleFormat
Definition: AudioFrame.hpp:30
ECodecType
Define if a codec is for encoding or decoding.
Definition: ICodec.hpp:19
AudioFrameDesc getAudioFrameDesc() const
Definition: AudioCodec.cpp:24
Description to create an audio frame. This corresponds to the number of samples, which corresponds to...
Definition: AudioFrame.hpp:14
void setAudioParameters(const AudioFrameDesc &audioFrameDesc)
Definition: AudioCodec.cpp:30
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy