1 /*
2  * Copyright (c) 2023-2023 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 OHOS_CAMERA_DPS_TRACK_H
17 #define OHOS_CAMERA_DPS_TRACK_H
18 
19 #include "av_common.h"
20 
21 namespace OHOS {
22 namespace CameraStandard {
23 namespace DeferredProcessing {
24 using namespace MediaAVCodec;
25 
26 enum class TrackType : int32_t {
27     AV_KEY_DEFAULT_TYPE = -1,
28     AV_KEY_AUDIO_TYPE = 0,
29     AV_KEY_VIDEO_TYPE = 1
30 };
31 
32 struct TrackFormat {
33     std::shared_ptr<Format> format;
34     int32_t trackId;
35 };
36 
37 class Track {
38 public:
39     Track() = default;
40     virtual ~Track();
41     const TrackFormat& GetFormat();
42     void SetFormat(const TrackFormat& format, TrackType type);
GetType()43     TrackType GetType()
44     {
45         return trackType_;
46     };
47 
48 private:
49     TrackFormat trackFormat_ {nullptr};
50     TrackType trackType_ {TrackType::AV_KEY_DEFAULT_TYPE};
51 };
52 } // namespace DeferredProcessing
53 } // namespace CameraStandard
54 } // namespace OHOS
55 #endif // OHOS_CAMERA_DPS_TRACK_H