• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# media_asset_capi.h
2
3## Overview
4
5The file declares the APIs related to media assets. You can use the APIs to obtain image or video information.
6
7**Library**: libmedia_asset_manager.so
8
9**File to include**: <multimedia/media_library/media_asset_capi.h>
10
11**System capability**: SystemCapability.FileManagement.PhotoAccessHelper.Core
12
13**Since**: 12
14
15**Related module**: [MediaAssetManager](capi-mediaassetmanager.md)
16
17## Summary
18
19### Functions
20
21| Name| Description|
22| -- | -- |
23| [MediaLibrary_ErrorCode OH_MediaAsset_GetUri(OH_MediaAsset* mediaAsset, const char** uri)](#oh_mediaasset_geturi) | Obtains the URI of a media asset.|
24| [MediaLibrary_ErrorCode OH_MediaAsset_GetMediaType(OH_MediaAsset* mediaAsset, MediaLibrary_MediaType* mediaType)](#oh_mediaasset_getmediatype) | Obtains the type of a media asset.|
25| [MediaLibrary_ErrorCode OH_MediaAsset_GetMediaSubType(OH_MediaAsset* mediaAsset,MediaLibrary_MediaSubType* mediaSubType)](#oh_mediaasset_getmediasubtype) | Obtains the subtype of a media asset.|
26| [MediaLibrary_ErrorCode OH_MediaAsset_GetDisplayName(OH_MediaAsset* mediaAsset, const char** displayName)](#oh_mediaasset_getdisplayname) | Obtains the display name of a media asset.|
27| [MediaLibrary_ErrorCode OH_MediaAsset_GetSize(OH_MediaAsset* mediaAsset, uint32_t* size)](#oh_mediaasset_getsize) | Obtains the size of a media asset file.|
28| [MediaLibrary_ErrorCode OH_MediaAsset_GetDateAdded(OH_MediaAsset* mediaAsset, uint32_t* dateAdded)](#oh_mediaasset_getdateadded) | Obtains the date when a media asset was added.|
29| [MediaLibrary_ErrorCode OH_MediaAsset_GetDateModified(OH_MediaAsset* mediaAsset, uint32_t* dateModified)](#oh_mediaasset_getdatemodified) | Obtains the date when a media asset was last modified.|
30| [MediaLibrary_ErrorCode OH_MediaAsset_GetDateTaken(OH_MediaAsset* mediaAsset, uint32_t* dateTaken)](#oh_mediaasset_getdatetaken) | Obtains the date when a media asset was taken.|
31| [MediaLibrary_ErrorCode OH_MediaAsset_GetDateAddedMs(OH_MediaAsset* mediaAsset, uint32_t* dateAddedMs)](#oh_mediaasset_getdateaddedms) | Obtains the date when a media asset was added, in ms.|
32| [MediaLibrary_ErrorCode OH_MediaAsset_GetDateModifiedMs(OH_MediaAsset* mediaAsset, uint32_t* dateModifiedMs)](#oh_mediaasset_getdatemodifiedms) | Obtains the date when a media asset was last modified, in ms.|
33| [MediaLibrary_ErrorCode OH_MediaAsset_GetDuration(OH_MediaAsset* mediaAsset, uint32_t* duration)](#oh_mediaasset_getduration) | Obtains the duration of a media asset, in ms.|
34| [MediaLibrary_ErrorCode OH_MediaAsset_GetWidth(OH_MediaAsset* mediaAsset, uint32_t* width)](#oh_mediaasset_getwidth) | Obtains the image width (in pixels) of a media asset.|
35| [MediaLibrary_ErrorCode OH_MediaAsset_GetHeight(OH_MediaAsset* mediaAsset, uint32_t* height)](#oh_mediaasset_getheight) | Obtains the image height (in pixels) of a media asset.|
36| [MediaLibrary_ErrorCode OH_MediaAsset_GetOrientation(OH_MediaAsset* mediaAsset, uint32_t* orientation)](#oh_mediaasset_getorientation) | Obtains the orientation of a media asset, in degrees.|
37| [MediaLibrary_ErrorCode OH_MediaAsset_IsFavorite(OH_MediaAsset* mediaAsset, uint32_t* favorite)](#oh_mediaasset_isfavorite) | Checks whether a media asset is favorited.|
38| [MediaLibrary_ErrorCode OH_MediaAsset_GetTitle(OH_MediaAsset* mediaAsset, const char** title)](#oh_mediaasset_gettitle) | Obtains the title of a media asset.|
39| [MediaLibrary_ErrorCode OH_MediaAsset_Release(OH_MediaAsset* mediaAsset)](#oh_mediaasset_release) | Releases a media asset.|
40
41## Function Description
42
43### OH_MediaAsset_GetUri()
44
45```
46MediaLibrary_ErrorCode OH_MediaAsset_GetUri(OH_MediaAsset* mediaAsset, const char** uri)
47```
48
49**Description**
50
51Obtains the URI of a media asset.
52
53**Since**: 12
54
55
56**Parameters**
57
58| Parameter| Description|
59| -- | -- |
60| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
61| const char** uri | Double pointer to the URI obtained.|
62
63**Return value**
64
65| Type| Description|
66| -- | -- |
67| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
68
69### OH_MediaAsset_GetMediaType()
70
71```
72MediaLibrary_ErrorCode OH_MediaAsset_GetMediaType(OH_MediaAsset* mediaAsset, MediaLibrary_MediaType* mediaType)
73```
74
75**Description**
76
77Obtains the type of a media asset.
78
79**Since**: 13
80
81
82**Parameters**
83
84| Parameter| Description|
85| -- | -- |
86| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
87| [MediaLibrary_MediaType](capi-media-asset-base-capi-h.md#medialibrary_mediatype)* mediaType | Pointer to the media asset type obtained.|
88
89**Return value**
90
91| Type| Description|
92| -- | -- |
93| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
94
95### OH_MediaAsset_GetMediaSubType()
96
97```
98MediaLibrary_ErrorCode OH_MediaAsset_GetMediaSubType(OH_MediaAsset* mediaAsset,MediaLibrary_MediaSubType* mediaSubType)
99```
100
101**Description**
102
103Obtains the subtype of a media asset.
104
105**Since**: 13
106
107
108**Parameters**
109
110| Parameter| Description|
111| -- | -- |
112| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
113| [MediaLibrary_MediaSubType](capi-media-asset-base-capi-h.md#medialibrary_mediasubtype)* mediaSubType | Pointer to the media asset subtype obtained.|
114
115**Return value**
116
117| Type| Description|
118| -- | -- |
119| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
120
121### OH_MediaAsset_GetDisplayName()
122
123```
124MediaLibrary_ErrorCode OH_MediaAsset_GetDisplayName(OH_MediaAsset* mediaAsset, const char** displayName)
125```
126
127**Description**
128
129Obtains the display name of a media asset.
130
131**Since**: 12
132
133
134**Parameters**
135
136| Parameter| Description|
137| -- | -- |
138| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
139| const char** displayName | Double pointer to the display name obtained.|
140
141**Return value**
142
143| Type| Description|
144| -- | -- |
145| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
146
147### OH_MediaAsset_GetSize()
148
149```
150MediaLibrary_ErrorCode OH_MediaAsset_GetSize(OH_MediaAsset* mediaAsset, uint32_t* size)
151```
152
153**Description**
154
155Obtains the size of a media asset file.
156
157**Since**: 12
158
159
160**Parameters**
161
162| Parameter| Description|
163| -- | -- |
164| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
165| uint32_t* size | Pointer to the file size obtained, in bytes.|
166
167**Return value**
168
169| Type| Description|
170| -- | -- |
171| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
172
173### OH_MediaAsset_GetDateAdded()
174
175```
176MediaLibrary_ErrorCode OH_MediaAsset_GetDateAdded(OH_MediaAsset* mediaAsset, uint32_t* dateAdded)
177```
178
179**Description**
180
181Obtains the date when a media asset was added.
182
183**Since**: 13
184
185
186**Parameters**
187
188| Parameter| Description|
189| -- | -- |
190| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
191| uint32_t* dateAdded | Pointer to the date obtained. The value is the number of seconds elapsed since the Unix Epoch time (00:00:00 UTC on January 1, 1970).|
192
193**Return value**
194
195| Type| Description|
196| -- | -- |
197| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
198
199### OH_MediaAsset_GetDateModified()
200
201```
202MediaLibrary_ErrorCode OH_MediaAsset_GetDateModified(OH_MediaAsset* mediaAsset, uint32_t* dateModified)
203```
204
205**Description**
206
207Obtains the date when a media asset (content not the media asset name) was last modified.
208
209**Since**: 13
210
211
212**Parameters**
213
214| Parameter| Description|
215| -- | -- |
216| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
217| uint32_t* dateModified | Pointer to the date obtained. The value is the number of milliseconds elapsed since the Unix Epoch time.|
218
219**Return value**
220
221| Type| Description|
222| -- | -- |
223| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
224
225### OH_MediaAsset_GetDateTaken()
226
227```
228MediaLibrary_ErrorCode OH_MediaAsset_GetDateTaken(OH_MediaAsset* mediaAsset, uint32_t* dateTaken)
229```
230
231**Description**
232
233Obtains the date when a media asset was taken.
234
235**Since**: 13
236
237
238**Parameters**
239
240| Parameter| Description|
241| -- | -- |
242| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
243| uint32_t* dateTaken | Pointer to the date obtained. The value is the number of seconds elapsed since the Unix Epoch time.|
244
245**Return value**
246
247| Type| Description|
248| -- | -- |
249| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
250
251### OH_MediaAsset_GetDateAddedMs()
252
253```
254MediaLibrary_ErrorCode OH_MediaAsset_GetDateAddedMs(OH_MediaAsset* mediaAsset, uint32_t* dateAddedMs)
255```
256
257**Description**
258
259Obtains the date when a media asset was added, in ms.
260
261**Since**: 13
262
263
264**Parameters**
265
266| Parameter| Description|
267| -- | -- |
268| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
269| uint32_t* dateAddedMs | Pointer to the date obtained, in ms. The value is the number of milliseconds elapsed since the Unix Epoch time.|
270
271**Return value**
272
273| Type| Description|
274| -- | -- |
275| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
276
277### OH_MediaAsset_GetDateModifiedMs()
278
279```
280MediaLibrary_ErrorCode OH_MediaAsset_GetDateModifiedMs(OH_MediaAsset* mediaAsset, uint32_t* dateModifiedMs)
281```
282
283**Description**
284
285Obtains the date when a media asset (content not the media asset name) was last modified, in ms.
286
287**Since**: 12
288
289
290**Parameters**
291
292| Parameter| Description|
293| -- | -- |
294| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
295| uint32_t* dateModifiedMs | Pointer to the date obtained, in ms. The value is the number of milliseconds elapsed since the Unix Epoch time.|
296
297**Return value**
298
299| Type| Description|
300| -- | -- |
301| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
302
303### OH_MediaAsset_GetDuration()
304
305```
306MediaLibrary_ErrorCode OH_MediaAsset_GetDuration(OH_MediaAsset* mediaAsset, uint32_t* duration)
307```
308
309**Description**
310
311Obtains the duration of a media asset, in ms.
312
313**Since**: 13
314
315
316**Parameters**
317
318| Parameter| Description|
319| -- | -- |
320| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
321| uint32_t* duration | Pointer to the duration obtained, in ms.|
322
323**Return value**
324
325| Type| Description|
326| -- | -- |
327| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
328
329### OH_MediaAsset_GetWidth()
330
331```
332MediaLibrary_ErrorCode OH_MediaAsset_GetWidth(OH_MediaAsset* mediaAsset, uint32_t* width)
333```
334
335**Description**
336
337Obtains the image width (in pixels) of a media asset.
338
339**Since**: 12
340
341
342**Parameters**
343
344| Parameter| Description|
345| -- | -- |
346| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
347| uint32_t* width | Pointer to the image width obtained, in pixels.|
348
349**Return value**
350
351| Type| Description|
352| -- | -- |
353| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
354
355### OH_MediaAsset_GetHeight()
356
357```
358MediaLibrary_ErrorCode OH_MediaAsset_GetHeight(OH_MediaAsset* mediaAsset, uint32_t* height)
359```
360
361**Description**
362
363Obtains the image height (in pixels) of a media asset.
364
365**Since**: 12
366
367
368**Parameters**
369
370| Parameter| Description|
371| -- | -- |
372| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
373| uint32_t* height | Pointer to the image height obtained, in pixels.|
374
375**Return value**
376
377| Type| Description|
378| -- | -- |
379| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
380
381### OH_MediaAsset_GetOrientation()
382
383```
384MediaLibrary_ErrorCode OH_MediaAsset_GetOrientation(OH_MediaAsset* mediaAsset, uint32_t* orientation)
385```
386
387**Description**
388
389Obtains the orientation of a media asset, in degrees.
390
391**Since**: 12
392
393
394**Parameters**
395
396| Parameter| Description|
397| -- | -- |
398| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
399| uint32_t* orientation | Pointer to the orientation of the image obtained, in degrees.|
400
401**Return value**
402
403| Type| Description|
404| -- | -- |
405| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
406
407### OH_MediaAsset_IsFavorite()
408
409```
410MediaLibrary_ErrorCode OH_MediaAsset_IsFavorite(OH_MediaAsset* mediaAsset, uint32_t* favorite)
411```
412
413**Description**
414
415Checks whether a media asset is favorited.
416
417**Since**: 13
418
419
420**Parameters**
421
422| Parameter| Description|
423| -- | -- |
424| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
425| uint32_t* favorite | Pointer to the favorite status obtained.|
426
427**Return value**
428
429| Type| Description|
430| -- | -- |
431| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
432
433### OH_MediaAsset_GetTitle()
434
435```
436MediaLibrary_ErrorCode OH_MediaAsset_GetTitle(OH_MediaAsset* mediaAsset, const char** title)
437```
438
439**Description**
440
441Obtains the title of a media asset.
442
443**Since**: 13
444
445
446**Parameters**
447
448| Parameter| Description|
449| -- | -- |
450| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
451| const char** title | Pointer to the media asset title obtained.|
452
453**Return value**
454
455| Type| Description|
456| -- | -- |
457| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.<br>**MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR**: internal system error.|
458
459### OH_MediaAsset_Release()
460
461```
462MediaLibrary_ErrorCode OH_MediaAsset_Release(OH_MediaAsset* mediaAsset)
463```
464
465**Description**
466
467Releases a media asset.
468
469**Since**: 12
470
471
472**Parameters**
473
474| Parameter| Description|
475| -- | -- |
476| [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)* mediaAsset | Pointer to an [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md) instance.|
477
478**Return value**
479
480| Type| Description|
481| -- | -- |
482| [MediaLibrary_ErrorCode](capi-media-asset-base-capi-h.md#medialibrary_errorcode) | **MEDIA_LIBRARY_OK**: operation success.<br>**MEDIA_LIBRARY_PARAMETER_ERROR**: incorrect parameters. Possible causes:<br>                                      1. A mandatory parameter is not specified.<br>                                      2. A parameter type is incorrect.<br>                                      3. Parameter verification fails.|
483