• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 HISTREAMER_FOUNDATION_AVBUFFER_QUEUE_DEFINE_H
17 #define HISTREAMER_FOUNDATION_AVBUFFER_QUEUE_DEFINE_H
18 
19 #include "common/status.h"
20 #include "buffer/avbuffer.h"
21 #include "iremote_broker.h"
22 
23 namespace OHOS {
24 namespace Media {
25 
26 constexpr uint32_t AVBUFFER_QUEUE_MAX_QUEUE_SIZE = 32;
27 constexpr uint32_t AVBUFFER_QUEUE_MAX_QUEUE_SIZE_FOR_LARGER = 150;
28 
29 class AVBufferQueueProducer;
30 class AVBufferQueueConsumer;
31 
32 class IBrokerListener : public IRemoteBroker {
33 public:
34     IBrokerListener() = default;
35     ~IBrokerListener() noexcept override = default;
36     virtual void OnBufferFilled(std::shared_ptr<AVBuffer>&) = 0;
37 
38     DECLARE_INTERFACE_DESCRIPTOR(u"Media.IAVBufferFilledListener")
39 };
40 
41 class IProducerListener : public IRemoteBroker {
42 public:
43     IProducerListener() = default;
44     ~IProducerListener() noexcept override = default;
45     virtual void OnBufferAvailable() = 0;
46     DECLARE_INTERFACE_DESCRIPTOR(u"Media.IProducerListener")
47 };
48 
49 // consumer不具备跨进程能力
50 class IConsumerListener : public RefBase {
51 public:
52     IConsumerListener() = default;
53     ~IConsumerListener() noexcept override = default;
54     virtual void OnBufferAvailable() = 0;
55 };
56 
57 } // namespace Media
58 } // namespace OHOS
59 
60 #endif // HISTREAMER_FOUNDATION_AVBUFFER_QUEUE_DEFINE_H
61