OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef MEDIA_BASE_ANDROID_MEDIA_URL_INTERCEPTOR_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_URL_INTERCEPTOR_H_ |
6 #define MEDIA_BASE_ANDROID_MEDIA_URL_INTERCEPTOR_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_URL_INTERCEPTOR_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "base/android/jni_android.h" | 12 #include "base/android/jni_android.h" |
11 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
12 | 14 |
13 namespace media { | 15 namespace media { |
14 | 16 |
15 // Interceptor for content embedders to handle custom media urls | 17 // Interceptor for content embedders to handle custom media urls |
16 // and translate them into files containing media. | 18 // and translate them into files containing media. |
17 class MEDIA_EXPORT MediaUrlInterceptor { | 19 class MEDIA_EXPORT MediaUrlInterceptor { |
18 public: | 20 public: |
19 virtual ~MediaUrlInterceptor() {}; | 21 virtual ~MediaUrlInterceptor() {}; |
20 | 22 |
21 // Returns true if the embedder has intercepted the url and | 23 // Returns true if the embedder has intercepted the url and |
22 // false otherwise. | 24 // false otherwise. |
23 // Output arguments (only when the url has been intercepted): | 25 // Output arguments (only when the url has been intercepted): |
24 // - |fd|: file descriptor to the file containing the media element. | 26 // - |fd|: file descriptor to the file containing the media element. |
25 // - |offset|: offset in bytes from the start of the file to the | 27 // - |offset|: offset in bytes from the start of the file to the |
26 // media element. | 28 // media element. |
27 // - |size|: size in bytes of the media element. | 29 // - |size|: size in bytes of the media element. |
28 virtual bool Intercept(const std::string& url, | 30 virtual bool Intercept(const std::string& url, |
29 int* fd, | 31 int* fd, |
30 int64_t* offset, | 32 int64_t* offset, |
31 int64_t* size) const = 0; | 33 int64_t* size) const = 0; |
32 }; | 34 }; |
33 | 35 |
34 } // namespace media | 36 } // namespace media |
35 | 37 |
36 #endif // MEDIA_BASE_ANDROID_MEDIA_URL_INTERCEPTOR_H_ | 38 #endif // MEDIA_BASE_ANDROID_MEDIA_URL_INTERCEPTOR_H_ |
OLD | NEW |