OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.pm.PackageManager; | 9 import android.content.pm.PackageManager; |
10 import android.media.MediaMetadataRetriever; | 10 import android.media.MediaMetadataRetriever; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 mDurationInMilliseconds = durationInMilliseconds; | 49 mDurationInMilliseconds = durationInMilliseconds; |
50 mWidth = width; | 50 mWidth = width; |
51 mHeight = height; | 51 mHeight = height; |
52 mSuccess = success; | 52 mSuccess = success; |
53 } | 53 } |
54 | 54 |
55 // TODO(andrewhayden): according to the spec, if duration is unknown | 55 // TODO(andrewhayden): according to the spec, if duration is unknown |
56 // then we must return NaN. If it is unbounded, then positive infinity. | 56 // then we must return NaN. If it is unbounded, then positive infinity. |
57 // http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html | 57 // http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html |
58 @CalledByNative("MediaMetadata") | 58 @CalledByNative("MediaMetadata") |
59 int getDurationInMilliseconds() { return mDurationInMilliseconds; } | 59 int getDurationInMilliseconds() { |
| 60 return mDurationInMilliseconds; |
| 61 } |
60 | 62 |
61 @CalledByNative("MediaMetadata") | 63 @CalledByNative("MediaMetadata") |
62 int getWidth() { return mWidth; } | 64 int getWidth() { |
| 65 return mWidth; |
| 66 } |
63 | 67 |
64 @CalledByNative("MediaMetadata") | 68 @CalledByNative("MediaMetadata") |
65 int getHeight() { return mHeight; } | 69 int getHeight() { |
| 70 return mHeight; |
| 71 } |
66 | 72 |
67 @CalledByNative("MediaMetadata") | 73 @CalledByNative("MediaMetadata") |
68 boolean isSuccess() { return mSuccess; } | 74 boolean isSuccess() { |
| 75 return mSuccess; |
| 76 } |
69 | 77 |
70 @Override | 78 @Override |
71 public String toString() { | 79 public String toString() { |
72 return "MediaMetadata[" | 80 return "MediaMetadata[" |
73 + "durationInMilliseconds=" + mDurationInMilliseconds | 81 + "durationInMilliseconds=" + mDurationInMilliseconds |
74 + ", width=" + mWidth | 82 + ", width=" + mWidth |
75 + ", height=" + mHeight | 83 + ", height=" + mHeight |
76 + ", success=" + mSuccess | 84 + ", success=" + mSuccess |
77 + "]"; | 85 + "]"; |
78 } | 86 } |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 @VisibleForTesting | 420 @VisibleForTesting |
413 void configure(String path) { | 421 void configure(String path) { |
414 mRetriever.setDataSource(path); | 422 mRetriever.setDataSource(path); |
415 } | 423 } |
416 | 424 |
417 @VisibleForTesting | 425 @VisibleForTesting |
418 String extractMetadata(int key) { | 426 String extractMetadata(int key) { |
419 return mRetriever.extractMetadata(key); | 427 return mRetriever.extractMetadata(key); |
420 } | 428 } |
421 } | 429 } |
OLD | NEW |