Chromium Code Reviews| Index: media/base/mac/videotoolbox_helpers.h |
| diff --git a/ios/chrome/browser/ui/webui/history/metrics_handler.h b/media/base/mac/videotoolbox_helpers.h |
| similarity index 12% |
| copy from ios/chrome/browser/ui/webui/history/metrics_handler.h |
| copy to media/base/mac/videotoolbox_helpers.h |
| index 3d6fca9df71b61b94c26c355c7f7715d72144453..72d1c580815a2dd216cbfe815dc9120d6a552846 100644 |
| --- a/ios/chrome/browser/ui/webui/history/metrics_handler.h |
| +++ b/media/base/mac/videotoolbox_helpers.h |
| @@ -2,50 +2,55 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_METRICS_HANDLER_H_ |
| -#define IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_METRICS_HANDLER_H_ |
| +#ifndef MEDIA_BASE_MAC_VIDEOTOOLBOX_HELPERS_H_ |
| +#define MEDIA_BASE_MAC_VIDEOTOOLBOX_HELPERS_H_ |
| -#include "base/compiler_specific.h" |
| -#include "base/macros.h" |
| -#include "ios/public/provider/web/web_ui_ios_message_handler.h" |
| +#include "base/mac/scoped_cftyperef.h" |
| +#include "media/base/mac/videotoolbox_glue.h" |
| +#include "media/base/media_export.h" |
| -/////////////////////////////////////////////////////////////////////////////// |
| -// MetricsHandler |
| +namespace media { |
| -// Let the page contents record UMA actions. Only use when you can't do it from |
| -// C++. For example, we currently use it to let the NTP log the position of the |
| -// Most Visited or Bookmark the user clicked on, as we don't get that |
| -// information through RequestOpenURL. You will need to update the metrics |
| -// dashboard with the action names you use, as our processor won't catch that |
| -// information (treat it as RecordComputedMetrics) |
| +MEDIA_EXPORT base::ScopedCFTypeRef<CFDictionaryRef> |
| +DictionaryWithKeysAndValues(CFTypeRef* keys, CFTypeRef* values, size_t size); |
|
miu
2016/02/04 22:23:20
All of these functions are VT-specific, but have r
miu
2016/02/04 22:23:20
Also, throughout this file, can you please add a c
emircan
2016/02/07 04:24:06
Done.
emircan
2016/02/07 04:24:06
Done.
|
| -namespace base { |
| -class ListValue; |
| -} |
| +MEDIA_EXPORT base::ScopedCFTypeRef<CFDictionaryRef> DictionaryWithKeyValue( |
| + CFTypeRef key, |
| + CFTypeRef value); |
| -class MetricsHandler : public web::WebUIIOSMessageHandler { |
| - public: |
| - MetricsHandler(); |
| - ~MetricsHandler() override; |
| +MEDIA_EXPORT base::ScopedCFTypeRef<CFArrayRef> ArrayWithIntegers(const int* v, |
| + size_t size); |
| - // WebUIIOSMessageHandler implementation. |
| - void RegisterMessages() override; |
| +template <typename NalSizeType> |
| +MEDIA_EXPORT void CopyNalsToAnnexB(char* avcc_buffer, |
| + const size_t avcc_size, |
| + std::string* annexb_buffer); |
| - // Callback for the "metricsHandler:recordAction" message. This records a |
| - // user action. |
| - void HandleRecordAction(const base::ListValue* args); |
| +MEDIA_EXPORT void CopySampleBufferToAnnexBBuffer( |
| + CoreMediaGlue::CMSampleBufferRef sbuf, |
| + std::string* annexb_buffer, |
| + bool keyframe); |
| - // TODO(dbeam): http://crbug.com/104338 |
| +using VTCompressionSessionRef = VideoToolboxGlue::VTCompressionSessionRef; |
|
miu
2016/02/04 22:23:20
style guide violation: Please remove this. Better
emircan
2016/02/07 04:24:06
Done.
|
| - // Callback for the "metricsHandler:recordInHistogram" message. This records |
| - // into a histogram. |args| contains the histogram name, the value to record, |
| - // and the maximum allowed value, which can be at most 4000. The histogram |
| - // will use at most 100 buckets, one for each 1, 10, or 100 different values, |
| - // depending on the maximum value. |
| - void HandleRecordInHistogram(const base::ListValue* args); |
| +MEDIA_EXPORT bool SetSessionProperty( |
| + base::ScopedCFTypeRef<VTCompressionSessionRef> session, |
| + const VideoToolboxGlue* const glue, |
| + CFStringRef key, |
| + int32_t value); |
| - private: |
| - DISALLOW_COPY_AND_ASSIGN(MetricsHandler); |
| -}; |
| +MEDIA_EXPORT bool SetSessionProperty( |
| + base::ScopedCFTypeRef<VTCompressionSessionRef> session, |
| + const VideoToolboxGlue* const glue, |
| + CFStringRef key, |
| + bool value); |
| -#endif // IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_METRICS_HANDLER_H_ |
| +MEDIA_EXPORT bool SetSessionProperty( |
| + base::ScopedCFTypeRef<VTCompressionSessionRef> session, |
| + const VideoToolboxGlue* const glue, |
| + CFStringRef key, |
| + CFStringRef value); |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_BASE_MAC_VIDEOTOOLBOX_HELPERS_H_ |