Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: patches/20_get_thumbnail_format.patch

Issue 2364793002: Revert "Uprev libmtp to 1.1.12" (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libmtp@master
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 diff --git a/src/libmtp.c b/src/libmtp.c 1 diff --git a/src/libmtp.c b/src/libmtp.c
2 index 288440f..c3df3f5 100644 2 index bbe2642..b8f856b 100644
3 --- a/src/libmtp.c 3 --- a/src/libmtp.c
4 +++ b/src/libmtp.c 4 +++ b/src/libmtp.c
5 @@ -9229,6 +9229,27 @@ int LIBMTP_TruncateObject(LIBMTP_mtpdevice_t *device, uin t32_t const id, 5 @@ -8962,6 +8962,27 @@ int LIBMTP_Get_Thumbnail(LIBMTP_mtpdevice_t *device, uint 32_t const id,
6 6 }
7 7
8 /** 8 /**
9 + * Get thumbnail format of a file. 9 + * Get thumbnail format of a file.
10 + * @param device a pointer to the device to get thumbnail format of. 10 + * @param device a pointer to the device to get thumbnail format of.
11 + * @param id the object ID of the file to get thumbnail format of. 11 + * @param id the object ID of the file to get thumbnail format of.
12 + * @return 0 on success, any other value means failure. 12 + * @return 0 on success, any other value means failure.
13 + */ 13 + */
14 +int LIBMTP_Get_Thumbnail_Format(LIBMTP_mtpdevice_t *device, uint32_t const id, 14 +int LIBMTP_Get_Thumbnail_Format(LIBMTP_mtpdevice_t *device, uint32_t const id,
15 + uint16_t *format) 15 + uint16_t *format)
16 +{ 16 +{
17 + PTPParams *params = (PTPParams *) device->params; 17 + PTPParams *params = (PTPParams *) device->params;
18 + uint16_t ret; 18 + uint16_t ret;
19 + 19 +
20 + PTPObjectInfo object_info; 20 + PTPObjectInfo object_info;
21 + ret = ptp_getobjectinfo(params, id, &object_info); 21 + ret = ptp_getobjectinfo(params, id, &object_info);
22 + if (ret != PTP_RC_OK) 22 + if (ret != PTP_RC_OK)
23 + return -1; 23 + return -1;
24 + 24 +
25 + *format = object_info.ThumbFormat; 25 + *format = object_info.ThumbFormat;
26 + return 0; 26 + return 0;
27 +} 27 +}
28 + 28 +
29 +/** 29 +/**
30 * This routine updates an album based on the metadata 30 * This routine updates an album based on the metadata
31 * supplied. If the <code>tracks</code> field of the metadata 31 * supplied. If the <code>tracks</code> field of the metadata
32 * contains a track listing, these tracks will be added to the 32 * contains a track listing, these tracks will be added to the
33 diff --git a/src/libmtp.h b/src/libmtp.h 33 diff --git a/src/libmtp.h b/src/libmtp.h
34 index ade0da0..7b31a8a 100644 34 index f923cc1..07aa273 100644
35 --- a/src/libmtp.h 35 --- a/src/libmtp.h
36 +++ b/src/libmtp.h 36 +++ b/src/libmtp.h
37 @@ -954,6 +954,8 @@ int LIBMTP_Get_Representative_Sample(LIBMTP_mtpdevice_t *, u int32_t const, 37 @@ -924,6 +924,8 @@ int LIBMTP_Get_Representative_Sample(LIBMTP_mtpdevice_t *, u int32_t const,
38 LIBMTP_filesampledata_t *); 38 LIBMTP_filesampledata_t *);
39 int LIBMTP_Get_Thumbnail(LIBMTP_mtpdevice_t *, uint32_t const, 39 int LIBMTP_Get_Thumbnail(LIBMTP_mtpdevice_t *, uint32_t const,
40 unsigned char **data, unsigned int *size); 40 unsigned char **data, unsigned int *size);
41 +int LIBMTP_Get_Thumbnail_Format(LIBMTP_mtpdevice_t *device, uint32_t const id, 41 +int LIBMTP_Get_Thumbnail_Format(LIBMTP_mtpdevice_t *device, uint32_t const id,
42 + uint16_t *format); 42 + uint16_t *format);
43 43
44 /** 44 /**
45 * @} 45 * @}
46 diff --git a/src/libmtp.h.in b/src/libmtp.h.in 46 diff --git a/src/libmtp.h.in b/src/libmtp.h.in
47 index 7523ac0..9935e2b 100644 47 index 2b2f0bb..49edd3c 100644
48 --- a/src/libmtp.h.in 48 --- a/src/libmtp.h.in
49 +++ b/src/libmtp.h.in 49 +++ b/src/libmtp.h.in
50 @@ -954,6 +954,8 @@ int LIBMTP_Get_Representative_Sample(LIBMTP_mtpdevice_t *, u int32_t const, 50 @@ -924,6 +924,8 @@ int LIBMTP_Get_Representative_Sample(LIBMTP_mtpdevice_t *, u int32_t const,
51 LIBMTP_filesampledata_t *); 51 LIBMTP_filesampledata_t *);
52 int LIBMTP_Get_Thumbnail(LIBMTP_mtpdevice_t *, uint32_t const, 52 int LIBMTP_Get_Thumbnail(LIBMTP_mtpdevice_t *, uint32_t const,
53 unsigned char **data, unsigned int *size); 53 unsigned char **data, unsigned int *size);
54 +int LIBMTP_Get_Thumbnail_Format(LIBMTP_mtpdevice_t *device, uint32_t const id, 54 +int LIBMTP_Get_Thumbnail_Format(LIBMTP_mtpdevice_t *device, uint32_t const id,
55 + uint16_t *format); 55 + uint16_t *format);
56 56
57 /** 57 /**
58 * @} 58 * @}
59 diff --git a/src/libmtp.sym b/src/libmtp.sym 59 diff --git a/src/libmtp.sym b/src/libmtp.sym
60 index 66b87f9..ee65ce4 100644 60 index 4130fe8..1148edd 100644
61 --- a/src/libmtp.sym 61 --- a/src/libmtp.sym
62 +++ b/src/libmtp.sym 62 +++ b/src/libmtp.sym
63 @@ -103,6 +103,7 @@ LIBMTP_Set_Playlist_Name 63 @@ -103,4 +103,5 @@ LIBMTP_Set_Playlist_Name
64 LIBMTP_Set_Album_Name 64 LIBMTP_Set_Album_Name
65 LIBMTP_Set_Object_Filename 65 LIBMTP_Set_Object_Filename
66 LIBMTP_Get_Thumbnail 66 LIBMTP_Get_Thumbnail
67 +LIBMTP_Get_Thumbnail_Format 67 +LIBMTP_Get_Thumbnail_Format
68 LIBMTP_Read_Event 68 LIBMTP_Read_Event
69 LIBMTP_Read_Event_Async
70 LIBMTP_Handle_Events_Timeout_Completed
OLDNEW
« no previous file with comments | « patches/17_fix_leak_in_libmtp_release_device.patch ('k') | patches/21_fix_build_with_new_glibc.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698