• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 PTS_AND_INDEX_CONVERSION_SAMPLE_H
17 #define PTS_AND_INDEX_CONVERSION_SAMPLE_H
18 
19 #include "native_avformat.h"
20 #include "native_avmemory.h"
21 #include "pts_and_index_conversion.h"
22 
23 namespace OHOS {
24 namespace Media {
25 class PtsAndIndexConversion {
26 public:
27     PtsAndIndexConversion() = default;
28     ~PtsAndIndexConversion();
29     const char *filePath = "/data/test/out.mp4";
30     bool Init(const uint8_t *data, size_t size);
31     void RunNormalTimeAndIndexConversions();
32 private:
33     int32_t fd_ = -1;
34     uint32_t index_ = 0;
35     uint32_t trackIndex_ = 0;
36     uint64_t relativePresentationTimeUs_ = 0;
37     std::shared_ptr<TimeAndIndexConversion> timeandindexConversions_ = nullptr;
38 };
39 } // namespace Media
40 } // namespace OHOS
41 
42 #endif // PTS_AND_INDEX_CONVERSION_SAMPLE_H
43