1# Media Subsystem Changelog
2
3## cl.multimedia.1 OH_AVCodecBufferAttr Behavior Changed
4
5**Access Level**
6
7Public API
8
9**Reason for Change**
10
11For a video track, **pts** in the obtained **OH_AVCodecBufferAttr** struct is the timestamp encapsulated in the file minus the track start time so that it starts from 0. However, the **pts** processing is different for the audio and video tracks. When **pts** is used for audio and video synchronization, abnormal video effects occur.
12
13**Change Impact**
14
15This change is a non-compatible change. The **pts** value of the video track obtained is no longer starting from 0. Specifically, the **pts** information encapsulated in the file is used.
16
17**Start API Level**
18
1910
20
21**Change Since**
22
23OpenHarmony SDK 5.0.0.39
24
25**Key API/Component Changes**
26
27| Name                     | Description                       |
28| ------------------------- | --------------------------- |
29| OH_AVCodecBufferAttr | Description information about the buffer of an **OH_AVCodec** instance.|
30
31**Adaptation Guide**
32
33The method of obtaining **pts** remains unchanged. However, no additional processing is performed internally. As such, **pts** is the timestamp encapsulated in the file. You can use and process **pts** based on your service logic. The sample code is as follows:
34
35```c++
36OH_AVBuffer *buffer = OH_AVBuffer_Create(w * h * 3 >> 1);
37if (buffer == nullptr) {
38    // Exception handling.
39}
40int32_t ret = OH_AVDemuxer_ReadSampleBuffer(demuxer, trackIndex, buffer);
41if (ret != AV_ERR_OK) {
42    // Exception handling.
43}
44
45OH_AVCodecBufferAttr info;
46ret = OH_AVBuffer_GetBufferAttr(buffer, &info);
47if (ret != AV_ERR_OK) {
48    // Exception handling.
49}
50int64_t newPts = info.pts;
51```
52
53You can also convert the obtained **pts** to **pts** before the change based on the track start time, **OH_MD_KEY_TRACK_START_TIME**, which can be obtained since API version 12. The code is as follows:
54```c++
55OH_AVFormat *trackFormat = OH_AVSource_GetTrackFormat(source, trackIndex);
56if (trackFormat == nullptr) {
57    // Exception handling.
58}
59int64_t startTime = 0;
60if (!OH_AVFormat_GetLongValue(trackFormat, OH_MD_KEY_TRACK_START_TIME, &startTime)) {
61    // Exception handling.
62}
63int64_t oldPts = newPts - startTime;
64```
65
66## cl.multimedia.2 EffectSuggestionType Behavior Changed
67
68**Access Level**
69
70System API
71
72**Reason for Change**
73
74Only system APIs can obtain or update the enums related to effect recommendation.
75
76**Change Impact**
77
78This change is a non-compatible change.
79
80Before change: The enum is a public interface.
81
82After change: The enum is a system interface.
83
84**Start API Level**
85
8612
87
88**Change Since**
89
90OpenHarmony SDK 5.0.0.39
91
92**Key API/Component Changes**
93
94EffectSuggestionType/camera component
95
96**Adaptation Guide**
97
98No adaptation is required. Related APIs are not opened. The change is only to keep the access level consistent with that of related APIs.
99
100## cl.multimedia.3 EffectSuggestionStatus Behavior Changed
101
102**Access Level**
103
104System API
105
106**Reason for Change**
107
108Only system APIs can obtain or update the classes related to effect recommendation.
109
110**Change Impact**
111
112This change is a non-compatible change.
113
114Before change: The class is a public interface.
115
116After change: The class is a system interface.
117
118**Start API Level**
119
12012
121
122**Change Since**
123
124OpenHarmony SDK 5.0.0.39
125
126**Key API/Component Changes**
127
128EffectSuggestionStatus/camera component
129
130**Adaptation Guide**
131
132No adaptation is required. Related APIs are not opened. The change is only to keep the access level consistent with that of related APIs.
133