1 /* 2 * Copyright (C) 2024 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 SetAudioEncoder(AudioCodecFormat encoder) = 0; 35 virtual int32_t SetAudioEncodingBitRate(int32_t bitRate) = 0; 36 virtual int32_t SetOutputFormat(OutputFormatType format) = 0; 37 virtual int32_t SetInputFile(int32_t fd, int64_t offset, int64_t size) = 0; 38 virtual int32_t SetOutputFile(int32_t fd) = 0; 39 virtual int32_t Prepare() = 0; 40 virtual int32_t Start() = 0; 41 virtual int32_t Pause() = 0; 42 virtual int32_t Resume() = 0; 43 virtual int32_t Cancel() = 0; 44 virtual int32_t Release() = 0; 45 virtual int32_t DestroyStub() = 0; 46 47 /** 48 * IPC code ID 49 */ 50 enum RecorderServiceMsg { 51 SET_LISTENER_OBJ = 0, 52 SET_VIDEO_ENCODER, 53 SET_VIDEO_SIZE, 54 SET_VIDEO_ENCODING_BIT_RATE, 55 SET_AUDIO_ENCODER, 56 SET_AUDIO_ENCODING_BIT_RATE, 57 SET_OUTPUT_FORMAT, 58 SET_INPUT_FILE_URL, 59 SET_INPUT_FILE_FD, 60 SET_OUTPUT_FILE, 61 PREPARE, 62 START, 63 PAUSE, 64 RESUME, 65 CANCEL, 66 RELEASE, 67 DESTROY, 68 }; 69 70 DECLARE_INTERFACE_DESCRIPTOR(u"IStandardTransCoderService"); 71 }; 72 } // namespace Media 73 } // namespace OHOS 74 #endif // I_STANDARD_RECORDER_SERVICE_H 75