修改json & 头文件include修改

Signed-off-by: linziming <linziming2@huawei.com>
Change-Id: Ie64d4eeb8b7948a258708ec471f598cab396fd86
This commit is contained in:
linziming 2023-12-28 07:45:19 +00:00
parent d1ef381f71
commit 811f38b405
17 changed files with 83 additions and 40 deletions

View File

@ -0,0 +1,32 @@
# Copyright (C) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos.gni")
import("//build/ohos/ndk/ndk.gni")
ohos_ndk_headers("native_media_acodec_header") {
dest_dir = "$ndk_headers_out_dir/multimedia/player_framework"
sources =
[ "//interface/sdk_c/multimedia/av_codec/native_avcodec_audiocodec.h" ]
}
ohos_ndk_library("libnative_media_acodec") {
ndk_description_file = "./libnative_media_acodec.ndk.json"
min_compact_version = "1"
output_name = "native_media_acodec"
output_extension = "so"
system_capability = "SystemCapability.Multimedia.Media.AudioCodec"
system_capability_headers =
[ "multimedia/player_framework/native_avcodec_audiocodec.h" ]
}

View File

@ -0,0 +1,17 @@
[
{ "name": "OH_AudioCodec_CreateByMime" },
{ "name": "OH_AudioCodec_CreateByName" },
{ "name": "OH_AudioCodec_Destroy" },
{ "name": "OH_AudioCodec_RegisterCallback" },
{ "name": "OH_AudioCodec_Configure" },
{ "name": "OH_AudioCodec_Prepare" },
{ "name": "OH_AudioCodec_Start" },
{ "name": "OH_AudioCodec_Stop" },
{ "name": "OH_AudioCodec_Flush" },
{ "name": "OH_AudioCodec_Reset" },
{ "name": "OH_AudioCodec_GetOutputDescription" },
{ "name": "OH_AudioCodec_SetParameter" },
{ "name": "OH_AudioCodec_PushInputBuffer" },
{ "name": "OH_AudioCodec_FreeOutputBuffer" },
{ "name": "OH_AudioCodec_IsValid" }
]

View File

@ -4,5 +4,6 @@
{ "name": "OH_AVDemuxer_SelectTrackByID" },
{ "name": "OH_AVDemuxer_UnselectTrackByID" },
{ "name": "OH_AVDemuxer_ReadSample" },
{ "name": "OH_AVDemuxer_ReadSampleBuffer" },
{ "name": "OH_AVDemuxer_SeekToTime" }
]

View File

@ -4,6 +4,7 @@
{ "name": "OH_AVMuxer_AddTrack" },
{ "name": "OH_AVMuxer_Start" },
{ "name": "OH_AVMuxer_WriteSample" },
{ "name": "OH_AVMuxer_WriteSampleBuffer" },
{ "name": "OH_AVMuxer_Stop" },
{ "name": "OH_AVMuxer_Destroy" }
]

View File

@ -56,6 +56,8 @@
{ "name": "OH_MD_KEY_DESCRIPTION" },
{ "name": "OH_MD_KEY_LYRICS" },
{ "name": "OH_MD_KEY_TRACK_COUNT" },
{ "name": "OH_AVCodec_GetCapability" },
{ "name": "OH_AVCodec_GetCapabilityByCategory" },
{ "name": "OH_AVCapability_IsHardware" },
{ "name": "OH_AVCapability_GetName" },
{ "name": "OH_AVCapability_GetMaxSupportedInstances" },
@ -80,4 +82,3 @@
{ "name": "OH_AVCapability_GetSupportedLevelsForProfile" },
{ "name": "OH_AVCapability_AreProfileAndLevelSupported" }
]

View File

@ -18,9 +18,6 @@
#include <stdint.h>
#include <stdio.h>
#include "native_averrors.h"
#include "native_avformat.h"
#include "native_avmemory.h"
#include "native_avcodec_base.h"
#ifdef __cplusplus

View File

@ -18,9 +18,6 @@
#include <stdint.h>
#include <stdio.h>
#include "native_averrors.h"
#include "native_avformat.h"
#include "native_avmemory.h"
#include "native_avcodec_base.h"
#ifdef __cplusplus

View File

@ -18,10 +18,8 @@
#include <stdint.h>
#include <stdio.h>
#include "native_averrors.h"
#include "native_avformat.h"
#include "native_avmemory.h"
#include "native_avcodec_base.h"
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -18,10 +18,8 @@
#include <stdint.h>
#include <stdio.h>
#include "native_averrors.h"
#include "native_avformat.h"
#include "native_avbuffer.h"
#include "native_avmemory.h"
#include "native_avbuffer_info.h"
#ifdef __cplusplus
extern "C" {

View File

@ -18,9 +18,6 @@
#include <stdint.h>
#include <stdio.h>
#include "native_averrors.h"
#include "native_avformat.h"
#include "native_avmemory.h"
#include "native_avcodec_base.h"
#ifdef __cplusplus

View File

@ -18,9 +18,6 @@
#include <stdint.h>
#include <stdio.h>
#include "native_averrors.h"
#include "native_avformat.h"
#include "native_avmemory.h"
#include "native_avcodec_base.h"
#ifdef __cplusplus

View File

@ -18,8 +18,6 @@
#include <stdint.h>
#include "native_avcodec_base.h"
#include "native_averrors.h"
#include "native_avmemory.h"
#include "native_avsource.h"
#ifdef __cplusplus
@ -27,7 +25,6 @@ extern "C" {
#endif
typedef struct OH_AVDemuxer OH_AVDemuxer;
typedef struct OH_AVBuffer OH_AVBuffer;
/**
* @brief Creates an OH_AVDemuxer instance for getting samples from source.

View File

@ -19,17 +19,12 @@
#include <stdint.h>
#include <stdio.h>
#include "native_avcodec_base.h"
#include "native_averrors.h"
#include "native_avformat.h"
#include "native_avmemory.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OH_AVMuxer OH_AVMuxer;
typedef struct OH_AVBuffer OH_AVBuffer;
/**
* @brief Create an OH_AVMuxer instance by output file description and format.
@ -95,16 +90,14 @@ OH_AVErrCode OH_AVMuxer_Start(OH_AVMuxer *muxer);
* @useinstead OH_AVMuxer_WriteSampleBuffer
* @since 10
*/
OH_AVErrCode OH_AVMuxer_WriteSample(OH_AVMuxer *muxer,
uint32_t trackIndex,
OH_AVMemory *sample,
OH_AVErrCode OH_AVMuxer_WriteSample(OH_AVMuxer *muxer, uint32_t trackIndex, OH_AVMemory *sample,
OH_AVCodecBufferAttr info);
/**
* @brief Write an encoded sample to the muxer.
* Note: This interface can only be called after OH_AVMuxer_Start and before OH_AVMuxer_Stop. The application needs to
* make sure that the samples are written to the right tracks. Also, it needs to make sure the samples for each track are
* written in chronological order.
* make sure that the samples are written to the right tracks. Also, it needs to make sure the samples for each track
* are written in chronological order.
* @syscap SystemCapability.Multimedia.Media.Muxer
* @param muxer Pointer to an OH_AVMuxer instance
* @param trackIndex The track index for this sample
@ -113,9 +106,7 @@ OH_AVErrCode OH_AVMuxer_WriteSample(OH_AVMuxer *muxer,
* otherwise returns a specific error code, refer to {@link OH_AVErrCode}
* @since 11
*/
OH_AVErrCode OH_AVMuxer_WriteSampleBuffer(OH_AVMuxer *muxer,
uint32_t trackIndex,
const OH_AVBuffer *sample);
OH_AVErrCode OH_AVMuxer_WriteSampleBuffer(OH_AVMuxer *muxer, uint32_t trackIndex, const OH_AVBuffer *sample);
/**
* @brief Stop the muxer.

View File

@ -3,6 +3,7 @@
{ "name": "OH_VideoDecoder_CreateByName" },
{ "name": "OH_VideoDecoder_Destroy" },
{ "name": "OH_VideoDecoder_SetCallback" },
{ "name": "OH_VideoDecoder_RegisterCallback" },
{ "name": "OH_VideoDecoder_SetSurface" },
{ "name": "OH_VideoDecoder_Configure" },
{ "name": "OH_VideoDecoder_Prepare" },
@ -13,7 +14,10 @@
{ "name": "OH_VideoDecoder_GetOutputDescription" },
{ "name": "OH_VideoDecoder_SetParameter" },
{ "name": "OH_VideoDecoder_PushInputData" },
{ "name": "OH_VideoDecoder_PushInputBuffer" },
{ "name": "OH_VideoDecoder_RenderOutputData" },
{ "name": "OH_VideoDecoder_RenderOutputBuffer" },
{ "name": "OH_VideoDecoder_FreeOutputData" },
{ "name": "OH_VideoDecoder_FreeOutputBuffer" },
{ "name": "OH_VideoDecoder_IsValid" }
]

View File

@ -3,6 +3,7 @@
{ "name": "OH_VideoEncoder_CreateByName" },
{ "name": "OH_VideoEncoder_Destroy" },
{ "name": "OH_VideoEncoder_SetCallback" },
{ "name": "OH_VideoEncoder_RegisterCallback" },
{ "name": "OH_VideoEncoder_Configure" },
{ "name": "OH_VideoEncoder_Prepare" },
{ "name": "OH_VideoEncoder_Start" },
@ -13,8 +14,10 @@
{ "name": "OH_VideoEncoder_SetParameter" },
{ "name": "OH_VideoEncoder_GetSurface" },
{ "name": "OH_VideoEncoder_FreeOutputData" },
{ "name": "OH_VideoEncoder_FreeOutputBuffer" },
{ "name": "OH_VideoEncoder_NotifyEndOfStream" },
{ "name": "OH_VideoEncoder_PushInputData" },
{ "name": "OH_VideoEncoder_PushInputBuffer" },
{ "name": "OH_VideoEncoder_GetInputDescription" },
{ "name": "OH_VideoEncoder_IsValid" }
]

View File

@ -13,12 +13,15 @@
import("//build/ohos.gni")
import("//build/ohos/ndk/ndk.gni")
ohos_ndk_headers("native_media_core_header") {
dest_dir = "$ndk_headers_out_dir/multimedia/player_framework"
sources = [
"//interface/sdk_c/multimedia/av_codec/native_averrors.h",
"//interface/sdk_c/multimedia/av_codec/native_avformat.h",
"//interface/sdk_c/multimedia/av_codec/native_avmemory.h",
"//interface/sdk_c/multimedia/media_foundation/native_avbuffer.h",
"//interface/sdk_c/multimedia/media_foundation/native_avbuffer_info.h",
"//interface/sdk_c/multimedia/media_foundation/native_averrors.h",
"//interface/sdk_c/multimedia/media_foundation/native_avformat.h",
"//interface/sdk_c/multimedia/media_foundation/native_avmemory.h",
]
}
@ -30,6 +33,8 @@ ohos_ndk_library("libnative_media_core") {
system_capability = "SystemCapability.Multimedia.Media.Core"
system_capability_headers = [
"multimedia/player_framework/native_avbuffer.h",
"multimedia/player_framework/native_avbuffer_info.h",
"multimedia/player_framework/native_averrors.h",
"multimedia/player_framework/native_avformat.h",
"multimedia/player_framework/native_avmemory.h",

View File

@ -21,6 +21,13 @@
{ "name": "OH_AVMemory_GetAddr" },
{ "name": "OH_AVMemory_GetSize" },
{ "name": "OH_AVMemory_Destroy" },
{ "name": "OH_AVCodec_GetCapability" },
{ "name": "OH_AVCodec_GetCapabilityByCategory" }
{ "name": "OH_AVBuffer_Create" },
{ "name": "OH_AVBuffer_Destroy" },
{ "name": "OH_AVBuffer_GetBufferAttr" },
{ "name": "OH_AVBuffer_SetBufferAttr" },
{ "name": "OH_AVBuffer_GetParameter" },
{ "name": "OH_AVBuffer_SetParameter" },
{ "name": "OH_AVBuffer_GetAddr" },
{ "name": "OH_AVBuffer_GetCapacity" },
{ "name": "OH_AVBuffer_GetNativeBuffer" }
]