1 /* 2 * Copyright (C) 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_LPP_AUDIO_STREAMER_SERVICE_H 17 #define I_STANDARD_LPP_AUDIO_STREAMER_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 "lpp_audio_streamer.h" 24 #include "lpp_common.h" 25 26 namespace OHOS { 27 namespace Media { 28 class IStandardLppAudioStreamerService : public IRemoteBroker { 29 public: 30 virtual ~IStandardLppAudioStreamerService() = default; 31 // virtual int32_t SetListenerObject(const sptr<IRemoteObject> &object) = 0; 32 33 virtual int32_t Init(const std::string &mime) = 0; 34 35 virtual int32_t SetParameter(const Format ¶m) = 0; 36 37 virtual int32_t Configure(const Format ¶m) = 0; 38 39 virtual int32_t Prepare() = 0; 40 41 virtual int32_t Start() = 0; 42 43 virtual int32_t Pause() = 0; 44 45 virtual int32_t Resume() = 0; 46 47 virtual int32_t Flush() = 0; 48 49 virtual int32_t Stop() = 0; 50 51 virtual int32_t Reset() = 0; 52 53 virtual int32_t Release() = 0; 54 55 virtual int32_t SetVolume(float volume) = 0; 56 57 virtual int32_t SetPlaybackSpeed(float speed) = 0; 58 59 virtual int32_t ReturnFrames(sptr<LppDataPacket> framePacket) = 0; 60 61 virtual int32_t RegisterCallback() = 0; 62 63 virtual int32_t SetLppAudioStreamerCallback() = 0; 64 65 virtual int32_t SetListenerObject(const sptr<IRemoteObject> &object) = 0; 66 67 virtual int32_t SetLppVideoStreamerId(const std::string videoStreamId) = 0; 68 69 virtual std::string GetStreamerId() = 0; 70 71 /** 72 * IPC code ID 73 */ 74 enum PlayerServiceMsg { 75 SET_PARAMETER = 0, 76 INIT, 77 CONFIGURE, 78 PREPARE, 79 START, 80 PAUSE, 81 RESUME, 82 FLUSH, 83 STOP, 84 RESET, 85 RELEASE, 86 SET_VOLUME, 87 SET_PLAYBACK_SPEED, 88 RETURN_FRAMES, 89 REGISTER_CALLBACK, 90 SET_AUDIO_STREAM_CALLBACK, 91 SET_LISTENER_OBJ, 92 SET_VIDOE_STREAMER_ID, 93 GET_STREAM_ID, 94 MAX_IPC_ID, // all IPC codes should be added before MAX_IPC_ID 95 }; 96 97 DECLARE_INTERFACE_DESCRIPTOR(u"IStandardLppAudioStreamerService"); 98 }; 99 } // namespace Media 100 } // namespace OHOS 101 #endif // I_STANDARD_PLAYER_SERVICE_H 102