| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "media/base/filters.h" | 6 #include "media/base/filters.h" |
| 7 #include "media/ffmpeg/ffmpeg_common.h" | 7 #include "media/ffmpeg/ffmpeg_common.h" |
| 8 #include "media/filters/ffmpeg_glue.h" | 8 #include "media/filters/ffmpeg_glue.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 if (result < 0) | 32 if (result < 0) |
| 33 result = AVERROR_IO; | 33 result = AVERROR_IO; |
| 34 return result; | 34 return result; |
| 35 } | 35 } |
| 36 | 36 |
| 37 int WriteContext(URLContext* h, unsigned char* buf, int size) { | 37 int WriteContext(URLContext* h, unsigned char* buf, int size) { |
| 38 // We don't support writing. | 38 // We don't support writing. |
| 39 return AVERROR_IO; | 39 return AVERROR_IO; |
| 40 } | 40 } |
| 41 | 41 |
| 42 offset_t SeekContext(URLContext* h, offset_t offset, int whence) { | 42 int64 SeekContext(URLContext* h, int64 offset, int whence) { |
| 43 media::FFmpegURLProtocol* protocol = ToProtocol(h->priv_data); | 43 media::FFmpegURLProtocol* protocol = ToProtocol(h->priv_data); |
| 44 offset_t new_offset = AVERROR_IO; | 44 int64 new_offset = AVERROR_IO; |
| 45 switch (whence) { | 45 switch (whence) { |
| 46 case SEEK_SET: | 46 case SEEK_SET: |
| 47 if (protocol->SetPosition(offset)) | 47 if (protocol->SetPosition(offset)) |
| 48 protocol->GetPosition(&new_offset); | 48 protocol->GetPosition(&new_offset); |
| 49 break; | 49 break; |
| 50 | 50 |
| 51 case SEEK_CUR: | 51 case SEEK_CUR: |
| 52 int64 pos; | 52 int64 pos; |
| 53 if (!protocol->GetPosition(&pos)) | 53 if (!protocol->GetPosition(&pos)) |
| 54 break; | 54 break; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } | 174 } |
| 175 | 175 |
| 176 std::string FFmpegGlue::GetProtocolKey(FFmpegURLProtocol* protocol) { | 176 std::string FFmpegGlue::GetProtocolKey(FFmpegURLProtocol* protocol) { |
| 177 // Use the FFmpegURLProtocol's memory address to generate the unique string. | 177 // Use the FFmpegURLProtocol's memory address to generate the unique string. |
| 178 // This also has the nice property that adding the same FFmpegURLProtocol | 178 // This also has the nice property that adding the same FFmpegURLProtocol |
| 179 // reference will not generate duplicate entries. | 179 // reference will not generate duplicate entries. |
| 180 return StringPrintf("%s://%p", kProtocol, static_cast<void*>(protocol)); | 180 return StringPrintf("%s://%p", kProtocol, static_cast<void*>(protocol)); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace media | 183 } // namespace media |
| OLD | NEW |