OLD | NEW |
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 #include "media/webm/chromeos/webm_encoder.h" | 5 #include "media/webm/chromeos/webm_encoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_generic_obj.h" | 10 #include "base/memory/scoped_generic_obj.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 public: | 48 public: |
49 void operator()(vpx_image_t* image) { | 49 void operator()(vpx_image_t* image) { |
50 vpx_img_free(image); | 50 vpx_img_free(image); |
51 } | 51 } |
52 }; | 52 }; |
53 | 53 |
54 namespace media { | 54 namespace media { |
55 | 55 |
56 namespace chromeos { | 56 namespace chromeos { |
57 | 57 |
58 WebmEncoder::WebmEncoder(const FilePath& output_path, | 58 WebmEncoder::WebmEncoder(const base::FilePath& output_path, |
59 int bitrate, | 59 int bitrate, |
60 bool realtime) | 60 bool realtime) |
61 : bitrate_(bitrate), | 61 : bitrate_(bitrate), |
62 deadline_(realtime ? VPX_DL_REALTIME : VPX_DL_GOOD_QUALITY), | 62 deadline_(realtime ? VPX_DL_REALTIME : VPX_DL_GOOD_QUALITY), |
63 output_path_(output_path), | 63 output_path_(output_path), |
64 has_errors_(false) { | 64 has_errors_(false) { |
65 ebml_writer_.write_cb = base::Bind( | 65 ebml_writer_.write_cb = base::Bind( |
66 &WebmEncoder::EbmlWrite, base::Unretained(this)); | 66 &WebmEncoder::EbmlWrite, base::Unretained(this)); |
67 ebml_writer_.serialize_cb = base::Bind( | 67 ebml_writer_.serialize_cb = base::Bind( |
68 &WebmEncoder::EbmlSerialize, base::Unretained(this)); | 68 &WebmEncoder::EbmlSerialize, base::Unretained(this)); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 case 8: | 314 case 8: |
315 return EbmlSerializeHelper(static_cast<const int64_t*>(buffer), len); | 315 return EbmlSerializeHelper(static_cast<const int64_t*>(buffer), len); |
316 default: | 316 default: |
317 NOTREACHED() << "Invalid EbmlSerialize length: " << len; | 317 NOTREACHED() << "Invalid EbmlSerialize length: " << len; |
318 } | 318 } |
319 } | 319 } |
320 | 320 |
321 } // namespace chromeos | 321 } // namespace chromeos |
322 | 322 |
323 } // namespace media | 323 } // namespace media |
OLD | NEW |