1 /* 2 * Copyright (C) 2024-2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef I_STANDARD_TRANSCODER_SERVICE_H 17 #define I_STANDARD_TRANSCODER_SERVICE_H 18 19 #include "ipc_types.h" 20 #include "iremote_broker.h" 21 #include "iremote_proxy.h" 22 #include "iremote_stub.h" 23 #include "transcoder.h" 24 25 namespace OHOS { 26 namespace Media { 27 class IStandardTransCoderService : public IRemoteBroker { 28 public: 29 virtual ~IStandardTransCoderService() = default; 30 virtual int32_t SetListenerObject(const sptr<IRemoteObject> &object) = 0; 31 virtual int32_t SetVideoEncoder(VideoCodecFormat encoder) = 0; 32 virtual int32_t SetVideoSize(int32_t width, int32_t height) = 0; 33 virtual int32_t SetVideoEncodingBitRate(int32_t rate) = 0; 34 virtual int32_t SetColorSpace(TranscoderColorSpace colorSpaceFormat) = 0; 35 virtual int32_t SetEnableBFrame(bool enableBFrame) = 0; 36 virtual int32_t SetAudioEncoder(AudioCodecFormat encoder) = 0; 37 virtual int32_t SetAudioEncodingBitRate(int32_t bitRate) = 0; 38 virtual int32_t SetOutputFormat(OutputFormatType format) = 0; 39 virtual int32_t SetInputFile(int32_t fd, int64_t offset, int64_t size) = 0; 40 virtual int32_t SetOutputFile(int32_t fd) = 0; 41 virtual int32_t Prepare() = 0; 42 virtual int32_t Start() = 0; 43 virtual int32_t Pause() = 0; 44 virtual int32_t Resume() = 0; 45 virtual int32_t Cancel() = 0; 46 virtual int32_t Release() = 0; 47 virtual int32_t DestroyStub() = 0; 48 49 /** 50 * IPC code ID 51 */ 52 enum RecorderServiceMsg { 53 SET_LISTENER_OBJ = 0, 54 SET_VIDEO_ENCODER, 55 SET_VIDEO_SIZE, 56 SET_VIDEO_ENCODING_BIT_RATE, 57 SET_COLOR_SPACE, 58 SET_ENABLE_B_FRAME, 59 SET_AUDIO_ENCODER, 60 SET_AUDIO_ENCODING_BIT_RATE, 61 SET_OUTPUT_FORMAT, 62 SET_INPUT_FILE_URL, 63 SET_INPUT_FILE_FD, 64 SET_OUTPUT_FILE, 65 PREPARE, 66 START, 67 PAUSE, 68 RESUME, 69 CANCEL, 70 RELEASE, 71 DESTROY, 72 }; 73 74 DECLARE_INTERFACE_DESCRIPTOR(u"IStandardTransCoderService"); 75 }; 76 } // namespace Media 77 } // namespace OHOS 78 #endif // I_STANDARD_RECORDER_SERVICE_H 79