修改命名空间以及IPC描述符

Signed-off-by: yj <yujie57@huawei.com>
This commit is contained in:
yj 2023-06-18 08:38:31 +00:00
parent e9b6412db5
commit 473c67e9ef
345 changed files with 860 additions and 864 deletions

View File

@ -24,7 +24,7 @@ constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "AVCodecAud
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
std::shared_ptr<AVCodecAudioDecoder> AudioDecoderFactory::CreateByMime(const std::string &mime)
{
AVCODEC_SYNC_TRACE;
@ -168,5 +168,5 @@ int32_t AVCodecAudioDecoderImpl::SetCallback(const std::shared_ptr<AVCodecCallba
CHECK_AND_RETURN_RET_LOG(callback != nullptr, AVCS_ERR_INVALID_VAL, "callback is nullptr");
return codecService_->SetCallback(callback);
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -20,7 +20,7 @@
#include "i_avcodec_service.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVCodecAudioDecoderImpl : public AVCodecAudioDecoder, public NoCopyable {
public:
AVCodecAudioDecoderImpl();
@ -45,6 +45,6 @@ public:
private:
std::shared_ptr<ICodecService> codecService_ = nullptr;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_AUDIO_DECODER_IMPL_H

View File

@ -24,7 +24,7 @@ constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "AVCodecAud
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
std::shared_ptr<AVCodecAudioEncoder> AudioEncoderFactory::CreateByMime(const std::string &mime)
{
AVCODEC_SYNC_TRACE;
@ -167,5 +167,5 @@ int32_t AVCodecAudioEncoderImpl::SetCallback(const std::shared_ptr<AVCodecCallba
CHECK_AND_RETURN_RET_LOG(callback != nullptr, AVCS_ERR_INVALID_VAL, "callback is nullptr");
return codecService_->SetCallback(callback);
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -21,7 +21,7 @@
#include "i_avcodec_service.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVCodecAudioEncoderImpl : public AVCodecAudioEncoder, public NoCopyable {
public:
AVCodecAudioEncoderImpl();
@ -46,6 +46,6 @@ public:
private:
std::shared_ptr<ICodecService> codecService_ = nullptr;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_AUDIO_ENCODER_IMPL_H

View File

@ -24,7 +24,7 @@ namespace {
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
std::shared_ptr<AVCodecVideoDecoder> VideoDecoderFactory::CreateByMime(const std::string &mime)
{
AVCODEC_SYNC_TRACE;
@ -207,5 +207,5 @@ int32_t AVCodecVideoDecoderImpl::SetCallback(const std::shared_ptr<AVCodecCallba
AVCODEC_SYNC_TRACE;
return codecService_->SetCallback(callback);
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -20,7 +20,7 @@
#include "i_avcodec_service.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVCodecVideoDecoderImpl : public AVCodecVideoDecoder, public NoCopyable {
public:
AVCodecVideoDecoderImpl();
@ -46,6 +46,6 @@ public:
private:
std::shared_ptr<ICodecService> codecService_ = nullptr;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_VIDEO_DECODER_IMPL_H

View File

@ -24,7 +24,7 @@ namespace {
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
std::shared_ptr<AVCodecVideoEncoder> VideoEncoderFactory::CreateByMime(const std::string &mime)
{
AVCODEC_SYNC_TRACE;
@ -230,5 +230,5 @@ int32_t AVCodecVideoEncoderImpl::GetInputFormat(Format &format)
AVCODEC_SYNC_TRACE;
return codecService_->GetInputFormat(format);
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -20,7 +20,7 @@
#include "i_avcodec_service.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVCodecVideoEncoderImpl : public AVCodecVideoEncoder, public NoCopyable {
public:
AVCodecVideoEncoderImpl();
@ -49,6 +49,6 @@ private:
std::shared_ptr<ICodecService> codecService_ = nullptr;
sptr<Surface> surface_ = nullptr;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_VIDEO_ENCODER_IMPL_H

View File

@ -26,7 +26,7 @@ constexpr int32_t BASE_BLOCK_PER_FRAME = 99;
constexpr int32_t BASE_BLOCK_PER_SECOND = 1485;
} // namespace
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
const std::map<int32_t, LevelParams> AVC_PARAMS_MAP = {
{AVC_LEVEL_1, LevelParams(1485, 99)}, {AVC_LEVEL_1b, LevelParams(1485, 99)},
{AVC_LEVEL_11, LevelParams(3000, 396)}, {AVC_LEVEL_12, LevelParams(6000, 396)},
@ -628,5 +628,5 @@ std::map<int32_t, std::vector<int32_t>> AVCodecInfo::GetSupportedLevelsForProfil
{
return data_->profileLevelsMap;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -22,7 +22,7 @@ namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "AVCodecListImpl"};
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
std::shared_ptr<AVCodecList> AVCodecListFactory::CreateAVCodecList()
{
static std::shared_ptr<AVCodecListImpl> impl = std::make_shared<AVCodecListImpl>();
@ -132,5 +132,5 @@ void *AVCodecListImpl::GetBuffer(const std::string &name, uint32_t sizeOfCap)
nameAddrMap_[name] = (void *)malloc(sizeOfCap);
return nameAddrMap_[name];
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -21,7 +21,7 @@
#include "i_codeclist_service.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVCodecListImpl : public AVCodecList, public NoCopyable {
public:
AVCodecListImpl();
@ -40,6 +40,6 @@ private:
std::unordered_map<std::string, void *> nameAddrMap_;
std::mutex mutex_;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_LIST_IMPL_H

View File

@ -30,7 +30,7 @@ namespace {
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
std::shared_ptr<AVDemuxer> AVDemuxerFactory::CreateWithSource(AVSource &source)
{
AVCodecTrace trace("AVDemuxerFactory::CreateWithSource");
@ -127,5 +127,5 @@ int32_t AVDemuxerImpl::SeekToTime(int64_t millisecond, AVSeekMode mode)
return demuxerClient_->SeekToTime(millisecond, mode);
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -23,7 +23,7 @@
#include "avsource_impl.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVDemuxerImpl : public AVDemuxer, public NoCopyable {
public:
AVDemuxerImpl();
@ -40,6 +40,6 @@ private:
std::shared_ptr<IDemuxerService> demuxerClient_ = nullptr;
std::string sourceUri_;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVDEMUXER_IMPL_H

View File

@ -28,7 +28,7 @@ namespace {
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
std::shared_ptr<AVMuxer> AVMuxerFactory::CreateAVMuxer(int32_t fd, OutputFormat format)
{
AVCodecTrace trace("AVMuxerFactory::CreateAVMuxer");
@ -111,5 +111,5 @@ int32_t AVMuxerImpl::Stop()
CHECK_AND_RETURN_RET_LOG(muxerService_ != nullptr, AVCS_ERR_INVALID_OPERATION, "AVMuxer Service does not exist");
return muxerService_->Stop();
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -20,7 +20,7 @@
#include "nocopyable.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVMuxerImpl : public AVMuxer, public NoCopyable {
public:
AVMuxerImpl(int32_t fd, OutputFormat format);
@ -38,6 +38,6 @@ private:
int32_t fd_ = -1;
OutputFormat format_ = OUTPUT_FORMAT_DEFAULT;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVMUXER_IMPL_H

View File

@ -27,7 +27,7 @@ namespace {
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
std::shared_ptr<AVSource> AVSourceFactory::CreateWithURI(const std::string &uri)
{
AVCodecTrace trace("AVSourceFactory::CreateWithURI");
@ -160,5 +160,5 @@ int32_t AVSourceImpl::GetTrackFormat(Format &format, uint32_t trackIndex)
return sourceClient_->GetTrackFormat(format, trackIndex);
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -21,7 +21,7 @@
#include "i_source_service.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVSourceImpl : public AVSource, public NoCopyable {
public:
AVSourceImpl();
@ -39,7 +39,7 @@ private:
std::shared_ptr<ISourceService> sourceClient_ = nullptr;
uint32_t trackCount_ = 0;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVSOURCE_IMPL_H

View File

@ -27,7 +27,7 @@ namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "NativeAudioDecoder"};
}
using namespace OHOS::Media;
using namespace OHOS::MediaAVCodec;
class NativeAudioDecoder;
struct AudioDecoderObject : public OH_AVCodec {
@ -171,7 +171,7 @@ private:
};
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
#ifdef __cplusplus
extern "C" {
#endif
@ -466,5 +466,5 @@ OH_AVErrCode OH_AudioDecoder_IsValid(OH_AVCodec *codec, bool *isValid)
#ifdef __cplusplus
};
#endif
} // namesapce Media
} // namesapce AVCodec
} // OHOS

View File

@ -27,7 +27,7 @@ namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "NativeAudioEncoder"};
}
using namespace OHOS::Media;
using namespace OHOS::MediaAVCodec;
class NativeAudioEncoderCallback;
struct AudioEncoderObject : public OH_AVCodec {
@ -174,7 +174,7 @@ private:
};
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
#ifdef __cplusplus
extern "C" {
#endif
@ -467,5 +467,5 @@ OH_AVErrCode OH_AudioEncoder_IsValid(OH_AVCodec *codec, bool *isValid)
#ifdef __cplusplus
};
#endif
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -29,7 +29,7 @@ namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "NativeVideoDecoder"};
}
using namespace OHOS::Media;
using namespace OHOS::MediaAVCodec;
class NativeVideoDecoderCallback;
struct VideoDecoderObject : public OH_AVCodec {

View File

@ -29,7 +29,7 @@ namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "NativeVideoEncoder"};
}
using namespace OHOS::Media;
using namespace OHOS::MediaAVCodec;
class NativeVideoEncoderCallback;
struct VideoEncoderObject : public OH_AVCodec {

View File

@ -26,7 +26,7 @@ namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "NativeAVDemuxer"};
}
using namespace OHOS::Media;
using namespace OHOS::MediaAVCodec;
struct DemuxerObject : public OH_AVDemuxer {
explicit DemuxerObject(const std::shared_ptr<AVDemuxer> &demuxer)

View File

@ -23,7 +23,7 @@ namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "NativeAVMuxer"};
}
using namespace OHOS::Media;
using namespace OHOS::MediaAVCodec;
struct AVMuxerObject : public OH_AVMuxer {
explicit AVMuxerObject(const std::shared_ptr<AVMuxer> &muxer)

View File

@ -25,7 +25,7 @@ namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "NativeAVSource"};
}
using namespace OHOS::Media;
using namespace OHOS::MediaAVCodec;
struct OH_AVSource *OH_AVSource_CreateWithURI(char *uri)
{

View File

@ -24,7 +24,7 @@
namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "NativeAVCapability"};
}
using namespace OHOS::Media;
using namespace OHOS::MediaAVCodec;
OH_AVCapability::~OH_AVCapability() {}

View File

@ -25,7 +25,7 @@ constexpr uint32_t MAX_STRING_LENGTH = 256;
constexpr uint32_t MAX_DUMP_LENGTH = 1024;
}
using namespace OHOS::Media;
using namespace OHOS::MediaAVCodec;
OH_AVFormat::OH_AVFormat()
: AVObjectMagic(AVMagic::AVCODEC_MAGIC_FORMAT)

View File

@ -45,18 +45,18 @@ struct AVObjectMagic : public OHOS::RefBase {
struct OH_AVFormat : public AVObjectMagic {
OH_AVFormat();
explicit OH_AVFormat(const OHOS::Media::Format &fmt);
explicit OH_AVFormat(const OHOS::MediaAVCodec::Format &fmt);
~OH_AVFormat() override;
OHOS::Media::Format format_;
OHOS::MediaAVCodec::Format format_;
char *outString_ = nullptr;
char *dumpInfo_ = nullptr;
};
struct OH_AVMemory : public AVObjectMagic {
explicit OH_AVMemory(const std::shared_ptr<OHOS::Media::AVSharedMemory> &mem);
explicit OH_AVMemory(const std::shared_ptr<OHOS::MediaAVCodec::AVSharedMemory> &mem);
~OH_AVMemory() override;
bool IsEqualMemory(const std::shared_ptr<OHOS::Media::AVSharedMemory> &mem);
const std::shared_ptr<OHOS::Media::AVSharedMemory> memory_;
bool IsEqualMemory(const std::shared_ptr<OHOS::MediaAVCodec::AVSharedMemory> &mem);
const std::shared_ptr<OHOS::MediaAVCodec::AVSharedMemory> memory_;
bool isUserCreated = false;
};
@ -66,9 +66,9 @@ struct OH_AVCodec : public AVObjectMagic {
};
struct OH_AVCapability : public OHOS::RefBase {
explicit OH_AVCapability(OHOS::Media::CapabilityData *capabilityData);
explicit OH_AVCapability(OHOS::MediaAVCodec::CapabilityData *capabilityData);
~OH_AVCapability() override;
OHOS::Media::CapabilityData *capabilityData_;
OHOS::MediaAVCodec::CapabilityData *capabilityData_;
};
struct OH_AVMuxer : public AVObjectMagic {

View File

@ -23,9 +23,9 @@ namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "OH_AVMemory"};
}
using namespace OHOS::Media;
using namespace OHOS::MediaAVCodec;
OH_AVMemory::OH_AVMemory(const std::shared_ptr<OHOS::Media::AVSharedMemory> &mem)
OH_AVMemory::OH_AVMemory(const std::shared_ptr<OHOS::MediaAVCodec::AVSharedMemory> &mem)
: AVObjectMagic(AVMagic::AVCODEC_MAGIC_SHARED_MEMORY), memory_(mem)
{
}
@ -34,7 +34,7 @@ OH_AVMemory::~OH_AVMemory()
{
}
bool OH_AVMemory::IsEqualMemory(const std::shared_ptr<OHOS::Media::AVSharedMemory> &mem)
bool OH_AVMemory::IsEqualMemory(const std::shared_ptr<OHOS::MediaAVCodec::AVSharedMemory> &mem)
{
return (mem == memory_) ? true : false;
}

View File

@ -22,11 +22,11 @@
#include "native_avmagic.h"
struct AVSourceObject : public OH_AVSource {
explicit AVSourceObject(const std::shared_ptr<OHOS::Media::AVSource> &source)
explicit AVSourceObject(const std::shared_ptr<OHOS::MediaAVCodec::AVSource> &source)
: OH_AVSource(AVMagic::AVCODEC_MAGIC_AVSOURCE), source_(source) {}
~AVSourceObject() = default;
const std::shared_ptr<OHOS::Media::AVSource> source_;
const std::shared_ptr<OHOS::MediaAVCodec::AVSource> source_;
};
#endif // NATIVE_OBJECT_H

View File

@ -18,7 +18,7 @@
#include <string>
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
using ErrorMessageFunc = std::function<std::string(const std::string &param1, const std::string &param2)>;
const std::map<AVCodecServiceErrCode, std::string> AVCS_ERRCODE_INFOS = {
{AVCS_ERR_OK, "success"},
@ -241,5 +241,5 @@ OH_AVErrCode AVCSErrorToOHAVErrCode(AVCodecServiceErrCode code)
return AV_ERR_UNKNOWN;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -20,7 +20,7 @@
#include "format.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
/**
* @brief Media type
*
@ -160,6 +160,6 @@ enum OutputFormat : uint32_t {
*/
OUTPUT_FORMAT_M4A = 6,
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AV_COMMOM_H

View File

@ -18,7 +18,7 @@
#include <cstdint>
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
/**
* @enum Audio sample formats
* @since 3.1
@ -54,6 +54,6 @@ enum AACProfile : int32_t {
AAC_PROFILE_LD = 5,
AAC_PROFILE_MAIN = 6,
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -22,7 +22,7 @@
#include "format.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVCodecAudioDecoder {
public:
virtual ~AVCodecAudioDecoder() = default;
@ -221,6 +221,6 @@ private:
AudioDecoderFactory() = default;
~AudioDecoderFactory() = default;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_AUDIO_DECODER_H

View File

@ -22,7 +22,7 @@
#include "format.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVCodecAudioEncoder {
public:
virtual ~AVCodecAudioEncoder() = default;
@ -221,6 +221,6 @@ private:
AudioEncoderFactory() = default;
~AudioEncoderFactory() = default;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_AUDIO_ENCODER_H

View File

@ -18,7 +18,7 @@
#include <string_view>
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVCodecCodecName {
public:
static constexpr std::string_view AUDIO_DECODER_MP3_NAME = "OH.Media.Codec.Decoder.Audio.Mpeg";
@ -35,7 +35,7 @@ private:
AVCodecCodecName() = delete;
~AVCodecCodecName() = delete;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -21,7 +21,7 @@
#include "format.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
/**
* @brief Error type of AVCodec
*
@ -142,6 +142,6 @@ enum VideoBitStreamFormat {
HVCC,
ANNEXB
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_COMMOM_H

View File

@ -22,7 +22,7 @@
#include "errors.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
using AVCSErrCode = ErrCode;
// bit 28~21 is subsys, bit 20~16 is Module. bit 15~0 is code
@ -90,6 +90,6 @@ __attribute__((visibility("default"))) std::string AVCSErrorToString(AVCodecServ
__attribute__((visibility("default"))) std::string OHAVErrCodeToString(OH_AVErrCode code);
__attribute__((visibility("default"))) std::string AVCSErrorToOHAVErrCodeString(AVCodecServiceErrCode code);
__attribute__((visibility("default"))) OH_AVErrCode AVCSErrorToOHAVErrCode(AVCodecServiceErrCode code);
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_ERRORS_H

View File

@ -24,7 +24,7 @@
#include "avcodec_audio_common.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
/**
* @brief AVCodec Type
*
@ -742,6 +742,6 @@ enum VideoEncodeBitrateMode : int32_t {
*/
CQ = 2,
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_INFO_H

View File

@ -21,7 +21,7 @@
#include "avcodec_info.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVCodecList {
public:
virtual ~AVCodecList() = default;
@ -70,6 +70,6 @@ private:
AVCodecListFactory() = default;
~AVCodecListFactory() = default;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_LIST_H

View File

@ -18,7 +18,7 @@
#include <string_view>
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
/**
* @enum Media mime type
*
@ -43,6 +43,6 @@ private:
AVCodecMimeType() = delete;
~AVCodecMimeType() = delete;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -23,7 +23,7 @@
#include "surface.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVCodecVideoDecoder {
public:
virtual ~AVCodecVideoDecoder() = default;
@ -234,6 +234,6 @@ private:
VideoDecoderFactory() = default;
~VideoDecoderFactory() = default;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_VIDEO_DECODER_H

View File

@ -23,7 +23,7 @@
#include "surface.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVCodecVideoEncoder {
public:
virtual ~AVCodecVideoEncoder() = default;
@ -254,6 +254,6 @@ private:
VideoEncoderFactory() = default;
~VideoEncoderFactory() = default;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_VIDEO_ENCODER_H

View File

@ -23,7 +23,7 @@
#include "avsource.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVDemuxer {
public:
~AVDemuxer() = default;
@ -93,6 +93,6 @@ private:
AVDemuxerFactory() = default;
~AVDemuxerFactory() = default;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVDEMUXER_H

View File

@ -22,7 +22,7 @@
#include "avcodec_common.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVMuxer {
public:
virtual ~AVMuxer() = default;
@ -99,7 +99,7 @@ private:
AVMuxerFactory() = default;
~AVMuxerFactory() = default;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVMUXER_H

View File

@ -20,7 +20,7 @@
#include <string>
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
/**
* @brief Provides a unified interface to implement convenient memory sharing
* mechanism. For those platforms that do not support multi-process, it may
@ -70,6 +70,6 @@ public:
*/
virtual uint32_t GetFlags() const = 0;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVSHAREDMEMORY_H

View File

@ -23,7 +23,7 @@
#include "format.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AVSource {
public:
virtual ~AVSource() = default;
@ -99,7 +99,7 @@ private:
AVSourceFactory() = default;
~AVSourceFactory() = default;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVSOURCE_H

View File

@ -21,7 +21,7 @@
#include <vector>
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
enum FormatDataType : uint32_t {
/* None */
FORMAT_TYPE_NONE,
@ -250,6 +250,6 @@ public:
private:
FormatDataMap formatMap_;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // FORMAT_H

View File

@ -19,7 +19,7 @@
#include "format.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
/**
* @brief Provides the uniform container for storing the media description.
*/
@ -311,6 +311,6 @@ enum MatrixCoefficient : int32_t {
MATRIX_COEFFICIENT_CHROMATICITY_CL = 13,
MATRIX_COEFFICIENT_ICTCP = 14,
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // MEDIA_DESCRIPTION_H

View File

@ -16,7 +16,6 @@
#ifndef AVCODEC_AUDIO_CHANNEL_LAYOUT_H
#define AVCODEC_AUDIO_CHANNEL_LAYOUT_H
#include <cstdint>
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -221,5 +221,4 @@ OH_AVErrCode OH_AudioDecoder_IsValid(OH_AVCodec *codec, bool *isValid);
#ifdef __cplusplus
}
#endif
#endif // NATIVE_AVCODEC_AUDIODECODER_H

View File

@ -22,7 +22,6 @@
#include "native_avformat.h"
#include "native_avmemory.h"
#include "native_avcodec_base.h"
#ifdef __cplusplus
extern "C" {
#endif
@ -216,5 +215,4 @@ OH_AVErrCode OH_AudioEncoder_IsValid(OH_AVCodec *codec, bool *isValid);
#ifdef __cplusplus
}
#endif
#endif // NATIVE_AVCODEC_AUDIOENCODER_H

View File

@ -29,18 +29,18 @@ namespace {
constexpr int32_t FILE_BIT_STREAM_MAX = 1000;
constexpr uint8_t HEX_WIDTH = 2;
const std::map<OHOS::Media::BitStreamDumpType, std::string_view> BIT_STREAM_DUMP_MAP = {
{ OHOS::Media::BitStreamDumpType::BIT_STREAM_DUMP_TYPE_DEFAULT, "Default" },
{ OHOS::Media::BitStreamDumpType::BIT_STREAM_DUMP_TYPE_VCODEC, "Video_Codec" },
{ OHOS::Media::BitStreamDumpType::BIT_STREAM_DUMP_TYPE_ACODEC, "Audio_Codec" },
{ OHOS::Media::BitStreamDumpType::BIT_STREAM_DUMP_TYPE_MUXER, "Muxer" },
{ OHOS::Media::BitStreamDumpType::BIT_STREAM_DUMP_TYPE_DEMUXER, "Demuxer" },
{ OHOS::Media::BitStreamDumpType::BIT_STREAM_DUMP_TYPE_SOURCE, "Source" },
const std::map<OHOS::MediaAVCodec::BitStreamDumpType, std::string_view> BIT_STREAM_DUMP_MAP = {
{ OHOS::MediaAVCodec::BitStreamDumpType::BIT_STREAM_DUMP_TYPE_DEFAULT, "Default" },
{ OHOS::MediaAVCodec::BitStreamDumpType::BIT_STREAM_DUMP_TYPE_VCODEC, "Video_Codec" },
{ OHOS::MediaAVCodec::BitStreamDumpType::BIT_STREAM_DUMP_TYPE_ACODEC, "Audio_Codec" },
{ OHOS::MediaAVCodec::BitStreamDumpType::BIT_STREAM_DUMP_TYPE_MUXER, "Muxer" },
{ OHOS::MediaAVCodec::BitStreamDumpType::BIT_STREAM_DUMP_TYPE_DEMUXER, "Demuxer" },
{ OHOS::MediaAVCodec::BitStreamDumpType::BIT_STREAM_DUMP_TYPE_SOURCE, "Source" },
};
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
AVCodecBitStreamDumper &AVCodecBitStreamDumper::GetInstance()
{
static AVCodecBitStreamDumper avcodecBitStreamDumper;
@ -183,5 +183,5 @@ void AVCodecBitStreamDumper::TaskProcessor()
ofStream.close();
}
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -28,7 +28,7 @@ constexpr char HISYSEVENT_DOMAIN_AVCODEC[] = "AV_CODEC";
} // namespace
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
bool AVCodecEvent::CreateMsg(const char* format, ...)
{
va_list args;
@ -112,5 +112,5 @@ AVCodecTrace::~AVCodecTrace()
FinishTrace(HITRACE_TAG_ZMEDIA);
}
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -29,7 +29,7 @@ namespace {
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
int32_t AVCodecDumpControler::AddInfo(const uint32_t dumpIdx, const std::string &name, const std::string &value)
{
CHECK_AND_RETURN_RET_LOG((dumpIdx >> DUMP_OFFSET_24) > 0, AVCS_ERR_INVALID_VAL,
@ -141,4 +141,4 @@ uint32_t AVCodecDumpControler::GetLevel(const uint32_t dumpIdx)
return level;
}
} // namespace OHOS
} // namespace Media
} // namespace MediaAVCodec

View File

@ -28,7 +28,7 @@ constexpr ::OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "AVCodecL
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
AVCodecLogDump &AVCodecLogDump::GetInstance()
{
static AVCodecLogDump avcodecLogDump;
@ -176,5 +176,5 @@ void AVCodecLogDump::TaskProcessor()
ofStream.close();
}
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -33,7 +33,7 @@ namespace {
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
AVCodecXCollie &AVCodecXCollie::GetInstance()
{
static AVCodecXCollie instance;
@ -145,5 +145,5 @@ void AVCodecXCollie::CancelTimer(uint64_t index)
return;
#endif
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -22,7 +22,7 @@
#include <condition_variable>
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
enum class BitStreamDumpType {
BIT_STREAM_DUMP_TYPE_DEFAULT,
BIT_STREAM_DUMP_TYPE_VCODEC,
@ -59,13 +59,13 @@ private:
#ifdef BITSTREAM_DUMP_ENABLE
#define AVCODEC_BITSTREAM_DUMP(type, name, index, buffer, size) \
do { \
(void)OHOS::Media::AVCodecBitStreamDumper::GetInstance().SaveBitStream( \
(void)OHOS::MediaAVCodec::AVCodecBitStreamDumper::GetInstance().SaveBitStream( \
type, name, index, buffer, size); \
} while (0)
#else
#define AVCODEC_BITSTREAM_DUMP(type, name, index, buffer, size)
#endif
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_LOG_DUMP_H

View File

@ -22,7 +22,7 @@
#include "hisysevent.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
enum class FaultType : int32_t {
FAULT_TYPE_INVALID = -1,
FAULT_TYPE_FREEZE = 0,
@ -69,6 +69,6 @@ public:
private:
bool isSync_ = false;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_DFX_H

View File

@ -22,7 +22,7 @@
#include "format.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class __attribute__((visibility("default"))) AVCodecDumpControler {
public:
int32_t AddInfo(const uint32_t dumpIdx, const std::string &name, const std::string &value = "");
@ -38,5 +38,5 @@ private:
std::vector<uint32_t> length_ = std::vector<uint32_t>(4, 0);
};
} // namespace OHOS
} // namespace Media
} // namespace MediaAVCodec
#endif // AVCODEC_DUMP_UTILS_H

View File

@ -19,7 +19,7 @@
#include <cinttypes>
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
#undef LOG_DOMAIN
#define LOG_DOMAIN 0xD002BAC
@ -81,6 +81,6 @@ namespace Media {
#define POINTER_MASK 0x00FFFFFF
#define FAKE_POINTER(addr) (POINTER_MASK & reinterpret_cast<uintptr_t>(addr))
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_LOG_H

View File

@ -21,7 +21,7 @@
#include <mutex>
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class __attribute__((visibility("default"))) AVCodecLogDump {
public:
static AVCodecLogDump &GetInstance();
@ -48,13 +48,13 @@ private:
#ifdef OHOS_MEDIA_AVCODEC_LOG_DUMP
#define AVCODEC_DUMP_LOG(fmt, args...) \
do { \
(void)OHOS::Media::AVCodecLogDump::GetInstance().SaveLog( \
(void)OHOS::MediaAVCodec::AVCodecLogDump::GetInstance().SaveLog( \
"{%s():%d} " fmt, __FUNCTION__, __LINE__, ##args); \
} while (0)
#else
#define AVCODEC_DUMP_LOG(fmt, args...)
#endif
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_LOG_DUMP_H

View File

@ -21,7 +21,7 @@
#include <mutex>
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class __attribute__((visibility("default"))) AVCodecXCollie {
public:
static AVCodecXCollie &GetInstance();
@ -59,6 +59,6 @@ private:
#define COLLIE_LISTEN(statement, args...) { AVCodecXcollieTimer xCollie(args); statement; }
#define CLIENT_COLLIE_LISTEN(statement, name) { AVCodecXcollieTimer xCollie(name, false, false, 30); statement; }
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // AVCODEC_XCOLLIE_H

View File

@ -21,7 +21,7 @@ constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "CodecBase"
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
int32_t CodecBase::NotifyEos()
{
AVCODEC_LOGW("NotifyEos is not supported");
@ -60,5 +60,5 @@ int32_t CodecBase::GetInputFormat(Format& format)
AVCODEC_LOGW("GetInputFormat is not supported");
return 0;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -21,7 +21,7 @@
#include "surface.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class CodecBase {
public:
CodecBase() = default;
@ -47,6 +47,6 @@ public:
virtual int32_t SignalRequestIDRFrame();
virtual int32_t GetInputFormat(Format& format);
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // CODECBASE_H

View File

@ -19,12 +19,12 @@
#include "avcodec_info.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class CodecListBase {
public:
virtual ~CodecListBase() = default;
virtual int32_t GetCapabilityList(std::vector<CapabilityData> &caps) = 0;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // CODECLISTBASE_H

View File

@ -19,7 +19,7 @@
#include "format.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class SourceBase {
public:
virtual ~SourceBase() = default;
@ -29,6 +29,6 @@ public:
virtual int32_t GetTrackFormat(Format &format, uint32_t trackIndex) = 0;
virtual uintptr_t GetSourceAddr() = 0;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // SOURCEBASE_H

View File

@ -24,7 +24,7 @@ constexpr uint8_t LOGD_FREQUENCY = 5;
} // namespace
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
AudioBufferInfo::AudioBufferInfo(const uint32_t &bufferSize, const std::string_view &name, const uint32_t &metaSize,
size_t align)
: isHasMeta_(false),
@ -158,5 +158,5 @@ bool AudioBufferInfo::ResetBuffer()
}
return true;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -22,7 +22,7 @@ constexpr uint8_t LOGD_FREQUENCY = 5;
} // namespace
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
constexpr short DEFAULT_BUFFER_LENGTH = 8;
constexpr short DEFAULT_SLEEP_TIME = 500;
constexpr short MAX_WAIT_TIMES = 20;
@ -169,5 +169,5 @@ std::shared_ptr<AudioBufferInfo> AudioBuffersManager::createNewBuffer()
bufferInfo_.emplace_back(buffer);
return buffer;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -25,7 +25,7 @@ constexpr uint8_t LOGD_FREQUENCY = 5;
} // namespace
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
AudioCodecAdapter::AudioCodecAdapter(const std::string &name) : state_(CodecState::RELEASED), name_(name)
{
AVCODEC_LOGI("enter constructor of adapter,name:%{public}s", name_.data());
@ -522,5 +522,5 @@ std::string_view AudioCodecAdapter::stateToString(CodecState state)
};
return stateStrMap[state];
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -25,7 +25,7 @@ constexpr uint8_t LOGD_FREQUENCY = 5;
} // namespace
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
constexpr short DEFAULT_TRY_DECODE_TIME = 10;
constexpr int TIMEOUT_MS = 1000;
const std::string_view INPUT_BUFFER = "inputBuffer";
@ -416,5 +416,5 @@ bool AudioCodecWorker::Begin()
outputCondition_.notify_all();
return true;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -25,7 +25,7 @@ constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "AvCodec-Au
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
static constexpr int32_t INPUT_BUFFER_SIZE_DEFAULT = 8192;
static constexpr int32_t OUTPUT_BUFFER_SIZE_DEFAULT = 4 * 1024 * 8;
constexpr std::string_view AUDIO_CODEC_NAME = "aac";
@ -114,5 +114,5 @@ std::string_view AudioFFMpegAacDecoderPlugin::GetCodecType() const noexcept
{
return AUDIO_CODEC_NAME;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -26,7 +26,7 @@ constexpr uint8_t LOGD_FREQUENCY = 5;
} // namespace
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
AudioFfmpegDecoderPlugin::AudioFfmpegDecoderPlugin()
: hasExtra_(false),
maxInputSize_(-1),
@ -353,5 +353,5 @@ int32_t AudioFfmpegDecoderPlugin::CloseCtxLocked()
}
return AVCodecServiceErrCode::AVCS_ERR_OK;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -32,7 +32,7 @@ static const int32_t FLAC_DECODER_SAMPLE_RATE_TABLE[] = {
} // namespace
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
constexpr std::string_view AUDIO_CODEC_NAME = "flac";
AudioFFMpegFlacDecoderPlugin::AudioFFMpegFlacDecoderPlugin() : basePlugin(std::make_unique<AudioFfmpegDecoderPlugin>())
{
@ -154,5 +154,5 @@ std::string_view AudioFFMpegFlacDecoderPlugin::GetCodecType() const noexcept
{
return AUDIO_CODEC_NAME;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -33,7 +33,7 @@ constexpr int INPUT_BUFFER_SIZE_DEFAULT = 8192;
} // namespace
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
constexpr std::string_view AUDIO_CODEC_NAME = "mp3";
AudioFFMpegMp3DecoderPlugin::AudioFFMpegMp3DecoderPlugin() : basePlugin(std::make_unique<AudioFfmpegDecoderPlugin>())
{
@ -148,5 +148,5 @@ std::string_view AudioFFMpegMp3DecoderPlugin::GetCodecType() const noexcept
{
return AUDIO_CODEC_NAME;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -33,7 +33,7 @@ constexpr int NUMBER_PER_BYTES = 255;
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
static constexpr int32_t INPUT_BUFFER_SIZE_DEFAULT = 8192;
static constexpr int32_t OUTPUT_BUFFER_SIZE_DEFAULT = 4 * 1024 * 8;
constexpr std::string_view AUDIO_CODEC_NAME = "vorbis";
@ -226,5 +226,5 @@ std::string_view AudioFFMpegVorbisDecoderPlugin::GetCodecType() const noexcept
{
return AUDIO_CODEC_NAME;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -44,7 +44,7 @@ static std::map<int32_t, uint8_t> sampleFreqMap = {{96000, 0}, {88200, 1}, {640
}
namespace OHOS {
namespace Media {
namespace MediaAVcodec {
AudioFFMpegAacEncoderPlugin::AudioFFMpegAacEncoderPlugin() : basePlugin(std::make_unique<AudioFfmpegEncoderPlugin>()) {}
AudioFFMpegAacEncoderPlugin::~AudioFFMpegAacEncoderPlugin()
@ -210,5 +210,5 @@ std::string_view AudioFFMpegAacEncoderPlugin::GetCodecType() const noexcept
{
return AUDIO_CODEC_NAME;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -25,7 +25,7 @@ constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "AvCodec-Au
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
AudioFfmpegEncoderPlugin::AudioFfmpegEncoderPlugin()
: maxInputSize_(-1), avCodec_(nullptr), avCodecContext_(nullptr), cachedFrame_(nullptr), avPacket_(nullptr),
prevPts_(0)
@ -376,5 +376,5 @@ void AudioFfmpegEncoderPlugin::RegisterHeaderFunc(HeaderFunc headerFunc)
GetHeaderFunc_ = headerFunc;
headerFuncValid_ = true;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -37,14 +37,14 @@ static const uint64_t FLAC_CHANNEL_LAYOUT_TABLE[] = {AV_CH_LAYOUT_MONO, AV_CH
AV_CH_LAYOUT_QUAD, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1,
AV_CH_LAYOUT_6POINT1, AV_CH_LAYOUT_7POINT1};
const std::map<int32_t, int32_t> BITS_PER_RAW_SAMPLE_MAP = {
{OHOS::Media::AudioSampleFormat::SAMPLE_S16LE, 16},
{OHOS::Media::AudioSampleFormat::SAMPLE_S24LE, 24},
{OHOS::Media::AudioSampleFormat::SAMPLE_S32LE, 32},
{OHOS::MediaAVCodec::AudioSampleFormat::SAMPLE_S16LE, 16},
{OHOS::MediaAVCodec::AudioSampleFormat::SAMPLE_S24LE, 24},
{OHOS::MediaAVCodec::AudioSampleFormat::SAMPLE_S32LE, 32},
};
} // namespace
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
constexpr std::string_view AUDIO_CODEC_NAME = "flac";
AudioFFMpegFlacEncoderPlugin::AudioFFMpegFlacEncoderPlugin() : basePlugin(std::make_unique<AudioFfmpegEncoderPlugin>())
{
@ -231,5 +231,5 @@ std::string_view AudioFFMpegFlacEncoderPlugin::GetCodecType() const noexcept
{
return AUDIO_CODEC_NAME;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -24,7 +24,7 @@
#include "nocopyable.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioBaseCodec : public AVCodecBaseFactory<AudioBaseCodec, std::string>, public NoCopyable {
public:
AudioBaseCodec() = default;
@ -51,7 +51,7 @@ public:
virtual std::string_view GetCodecType() const noexcept = 0;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -26,7 +26,7 @@
#include "nocopyable.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioBufferInfo : public NoCopyable {
public:
AudioBufferInfo(const uint32_t &bufferSize, const std::string_view &name, const uint32_t &metaSize = 0,
@ -75,6 +75,6 @@ private:
AVCodecBufferInfo info_;
AVCodecBufferFlag flag_;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -26,7 +26,7 @@
#include <string_view>
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioBuffersManager : public NoCopyable {
public:
AudioBuffersManager(const uint32_t &bufferSize, const std::string_view &name, const uint32_t &metaSize = 0,
@ -65,7 +65,7 @@ private:
std::string_view name_;
std::vector<std::shared_ptr<AudioBufferInfo>> bufferInfo_;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -23,7 +23,7 @@
#include "nocopyable.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioCodecAdapter : public CodecBase, public NoCopyable {
public:
explicit AudioCodecAdapter(const std::string &name);
@ -75,6 +75,6 @@ private:
int32_t doConfigure(const Format &format);
std::string_view stateToString(CodecState state);
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -28,7 +28,7 @@
#include <queue>
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioCodecWorker : public NoCopyable {
public:
AudioCodecWorker(const std::shared_ptr<AudioBaseCodec> &codec, const std::shared_ptr<AVCodecCallback> &callback);
@ -86,7 +86,7 @@ private:
std::shared_ptr<AudioBuffersManager> outputBuffer_;
std::queue<uint32_t> inBufIndexQue_;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -17,7 +17,7 @@
#define AV_CODEC_AUDIO_COMMON_INFO_H
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
enum class BufferStatus {
IDLE,
OWEN_BY_CLIENT,
@ -36,7 +36,7 @@ enum class CodecState {
RESUMING, // FLUSHED -> RUNNING
RELEASING, // {ANY EXCEPT RELEASED} -> RELEASED
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -21,7 +21,7 @@
#include "avcodec_codec_name.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioFFMpegAacDecoderPlugin : public AudioBaseCodec::CodecRegister<AudioFFMpegAacDecoderPlugin> {
public:
AudioFFMpegAacDecoderPlugin();
@ -45,6 +45,6 @@ public:
private:
std::unique_ptr<AudioFfmpegDecoderPlugin> basePlugin;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -29,7 +29,7 @@ extern "C" {
#endif
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioFfmpegDecoderPlugin : public NoCopyable {
public:
AudioFfmpegDecoderPlugin();
@ -89,7 +89,7 @@ private:
int32_t ReceiveBuffer(std::shared_ptr<AudioBufferInfo> &outBuffer);
int32_t ReceiveFrameSucc(std::shared_ptr<AudioBufferInfo> &outBuffer);
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -21,7 +21,7 @@
#include "avcodec_codec_name.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioFFMpegFlacDecoderPlugin : public AudioBaseCodec::CodecRegister<AudioFFMpegFlacDecoderPlugin> {
public:
AudioFFMpegFlacDecoderPlugin();
@ -47,6 +47,6 @@ private:
int32_t channels;
std::unique_ptr<AudioFfmpegDecoderPlugin> basePlugin;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -21,7 +21,7 @@
#include "avcodec_codec_name.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioFFMpegMp3DecoderPlugin : public AudioBaseCodec::CodecRegister<AudioFFMpegMp3DecoderPlugin> {
public:
AudioFFMpegMp3DecoderPlugin();
@ -50,6 +50,6 @@ private:
int64_t bitRate;
std::unique_ptr<AudioFfmpegDecoderPlugin> basePlugin;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -21,7 +21,7 @@
#include "avcodec_codec_name.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioFFMpegVorbisDecoderPlugin : public AudioBaseCodec::CodecRegister<AudioFFMpegVorbisDecoderPlugin> {
public:
AudioFFMpegVorbisDecoderPlugin();
@ -52,6 +52,6 @@ private:
std::unique_ptr<AudioFfmpegDecoderPlugin> basePlugin;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -21,7 +21,7 @@
#include "avcodec_codec_name.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioFFMpegAacEncoderPlugin : public AudioBaseCodec::CodecRegister<AudioFFMpegAacEncoderPlugin> {
public:
AudioFFMpegAacEncoderPlugin();
@ -47,6 +47,6 @@ private:
bool CheckFormat(const Format &format) const;
std::unique_ptr<AudioFfmpegEncoderPlugin> basePlugin;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -30,7 +30,7 @@ extern "C" {
#endif
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioFfmpegEncoderPlugin : NoCopyable {
using HeaderFunc = std::function<int32_t(std::string &header, uint32_t &headerSize, std::shared_ptr<AVCodecContext>,
uint32_t dataLength)>;
@ -78,7 +78,7 @@ private:
bool headerFuncValid_ = false;
uint32_t channelsBytesPerSample_ {1};
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -21,7 +21,7 @@
#include "avcodec_codec_name.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioFFMpegFlacEncoderPlugin : public AudioBaseCodec::CodecRegister<AudioFFMpegFlacEncoderPlugin> {
public:
AudioFFMpegFlacEncoderPlugin();
@ -49,6 +49,6 @@ private:
int32_t channels;
std::unique_ptr<AudioFfmpegEncoderPlugin> basePlugin;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -33,7 +33,7 @@
#include "task_thread.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
namespace Codec {
class FCodec : public CodecBase {
public:
@ -151,6 +151,6 @@ private:
std::atomic<bool> isBufferAllocated_ = false;
};
} // namespace Codec
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // FCODEC_H

View File

@ -18,7 +18,7 @@
#include "codecbase.h"
#include "codeclistbase.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class HCodecLoader {
public:
static std::shared_ptr<CodecBase> CreateByName(const std::string &name);
@ -37,6 +37,6 @@ private:
std::shared_ptr<CodecBase> Create(const std::string &name);
int32_t GetCaps(std::vector<CapabilityData> &caps);
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -23,7 +23,7 @@
#include "avcodec_codec_name.h"
#include "fcodec.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
namespace Codec {
namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "FCodec"};
@ -1110,5 +1110,5 @@ int32_t FCodec::GetCodecCapability(std::vector<CapabilityData> &capaArray)
return AVCS_ERR_OK;
}
} // namespace Codec
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -18,7 +18,7 @@
#include "hcodec_loader.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "codecLoader"};
const char *HCODEC_CREATE_FUNC_NAME = "CreateHCodecByName";
@ -76,5 +76,5 @@ int32_t HCodecLoader::GetCaps(std::vector<CapabilityData> &caps)
{
return getCapsFunc_(caps);
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -18,7 +18,7 @@
#include "avcodec_codec_name.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
const std::vector<int32_t> AUDIO_SAMPLE_RATE = {8000, 11025, 12000, 16000, 22050, 24000,
32000, 44100, 48000, 64000, 88200, 96000};
constexpr int MAX_AUDIO_CHANNEL_COUNT = 8;
@ -146,5 +146,5 @@ std::vector<CapabilityData> AudioCodeclistInfo::GetAudioCapabilities() const noe
{
return audioCapabilities_;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -18,7 +18,7 @@
#include "avcodec_info.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class AudioCodeclistInfo {
public:
~AudioCodeclistInfo();
@ -35,6 +35,6 @@ private:
std::vector<CapabilityData> audioCapabilities_;
AudioCodeclistInfo();
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif

View File

@ -24,7 +24,7 @@ constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "CodecAbili
}
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
std::unordered_map<CodecType, std::shared_ptr<CodecListBase>> GetCodecLists()
{
std::unordered_map<CodecType, std::shared_ptr<CodecListBase>> codecLists;
@ -100,5 +100,5 @@ std::unordered_map<std::string, std::vector<size_t>> CodecAbilitySingleton::GetM
std::lock_guard<std::mutex> lock(mutex_);
return mimeCapIdxMap_;
}
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS

View File

@ -23,7 +23,7 @@
#include "avcodec_codec_name.h"
namespace OHOS {
namespace Media {
namespace MediaAVCodec {
class __attribute__((visibility("default"))) CodecAbilitySingleton : public NoCopyable {
public:
~CodecAbilitySingleton();
@ -40,6 +40,6 @@ private:
std::unordered_map<std::string, CodecType> nameCodecTypeMap_;
std::mutex mutex_;
};
} // namespace Media
} // namespace MediaAVCodec
} // namespace OHOS
#endif // CODEABILITY_SINGLETON_H

Some files were not shown because too many files have changed in this diff Show More