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

Side by Side Diff: chrome/common/extensions/api/media_galleries.idl

Issue 121383002: Media Galleries API Metadata: Add audio video metadata extractor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: refine metadata extraction logic Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Use the <code>chrome.mediaGalleries</code> API to access media files (images, 5 // Use the <code>chrome.mediaGalleries</code> API to access media files (images,
6 // video, audio) from the user's local disks (with the user's consent). 6 // video, audio) from the user's local disks (with the user's consent).
7 namespace mediaGalleries { 7 namespace mediaGalleries {
8 8
9 [inline_doc] enum GetMediaFileSystemsInteractivity { 9 [inline_doc] enum GetMediaFileSystemsInteractivity {
10 // Do not act interactively. 10 // Do not act interactively.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // True if the device is currently available. 62 // True if the device is currently available.
63 boolean isAvailable; 63 boolean isAvailable;
64 }; 64 };
65 65
66 callback MediaFileSystemsMetadataCallback = 66 callback MediaFileSystemsMetadataCallback =
67 void (MediaFileSystemMetadata[] metadata); 67 void (MediaFileSystemMetadata[] metadata);
68 68
69 dictionary MediaMetadata { 69 dictionary MediaMetadata {
70 // The browser sniffed mime type. 70 // The browser sniffed mime type.
71 DOMString mimeType; 71 DOMString mimeType;
72
73 // Defined for images and video. In pixels.
74 long? height;
75 long? width;
76
77 // Defined for audio and video.
78 long? durationSeconds;
acolwell GONE FROM CHROMIUM 2014/01/03 19:14:04 nit: Consider using a double since time in HTMLMed
tommycli 2014/01/03 23:08:36 Done.
79
80 // FFmpeg-defined generic fields.
acolwell GONE FROM CHROMIUM 2014/01/03 19:14:04 I don't think it is wise to expose these fields in
Lei Zhang 2014/01/03 23:00:15 Chrome extensions and apps are not available on mo
tommycli 2014/01/03 23:08:36 Comment might be misleading. FFmpeg inspired the t
81 DOMString? album;
82 DOMString? artist;
83 DOMString? comment;
84 DOMString? copyright;
85 long? disc;
86 DOMString? genre;
87 DOMString? language;
88 DOMString? title;
89 long? track;
72 }; 90 };
73 91
74 callback MediaMetadataCallback = void (MediaMetadata metadata); 92 callback MediaMetadataCallback = void (MediaMetadata metadata);
75 93
76 interface Functions { 94 interface Functions {
77 // Get the media galleries configured in this user agent. If none are 95 // Get the media galleries configured in this user agent. If none are
78 // configured or available, the callback will receive an empty array. 96 // configured or available, the callback will receive an empty array.
79 static void getMediaFileSystems(optional MediaFileSystemsDetails details, 97 static void getMediaFileSystems(optional MediaFileSystemsDetails details,
80 MediaFileSystemsCallback callback); 98 MediaFileSystemsCallback callback);
81 99
82 // Get metadata about a specific media file system. 100 // Get metadata about a specific media file system.
83 [nocompile] static MediaFileSystemMetadata getMediaFileSystemMetadata( 101 [nocompile] static MediaFileSystemMetadata getMediaFileSystemMetadata(
84 [instanceOf=DOMFileSystem] object mediaFileSystem); 102 [instanceOf=DOMFileSystem] object mediaFileSystem);
85 103
86 // Get metadata for all available media galleries. 104 // Get metadata for all available media galleries.
87 static void getAllMediaFileSystemMetadata( 105 static void getAllMediaFileSystemMetadata(
88 MediaFileSystemsMetadataCallback callback); 106 MediaFileSystemsMetadataCallback callback);
89 107
90 // Gets the media-specific metadata for a media file. This should work 108 // Gets the media-specific metadata for a media file. This should work
91 // for files in media galleries as well as other DOM filesystems. 109 // for files in media galleries as well as other DOM filesystems.
92 static void getMetadata([instanceOf=Blob] object mediaFile, 110 static void getMetadata([instanceOf=Blob] object mediaFile,
93 optional MediaMetadataOptions options, 111 optional MediaMetadataOptions options,
94 MediaMetadataCallback callback); 112 MediaMetadataCallback callback);
95 }; 113 };
96 114
97 }; 115 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698