OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // TODO(scherkus): clean up PipelineImpl... too many crazy function names, | 5 // TODO(scherkus): clean up PipelineImpl... too many crazy function names, |
6 // potential deadlocks, etc... | 6 // potential deadlocks, etc... |
7 | 7 |
8 #include "media/base/pipeline_impl.h" | 8 #include "media/base/pipeline_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 void PipelineImpl::SeekTask(base::TimeDelta time, | 867 void PipelineImpl::SeekTask(base::TimeDelta time, |
868 const PipelineStatusCB& seek_callback) { | 868 const PipelineStatusCB& seek_callback) { |
869 DCHECK_EQ(MessageLoop::current(), message_loop_); | 869 DCHECK_EQ(MessageLoop::current(), message_loop_); |
870 DCHECK(!IsPipelineStopPending()); | 870 DCHECK(!IsPipelineStopPending()); |
871 | 871 |
872 // Suppress seeking if we're not fully started. | 872 // Suppress seeking if we're not fully started. |
873 if (state_ != kStarted && state_ != kEnded) { | 873 if (state_ != kStarted && state_ != kEnded) { |
874 // TODO(scherkus): should we run the callback? I'm tempted to say the API | 874 // TODO(scherkus): should we run the callback? I'm tempted to say the API |
875 // will only execute the first Seek() request. | 875 // will only execute the first Seek() request. |
876 VLOG(1) << "Media pipeline has not started, ignoring seek to " | 876 VLOG(1) << "Media pipeline has not started, ignoring seek to " |
877 << time.InMicroseconds(); | 877 << time.InMicroseconds(); |
878 return; | 878 return; |
879 } | 879 } |
880 | 880 |
881 DCHECK(!seek_pending_); | 881 DCHECK(!seek_pending_); |
882 seek_pending_ = true; | 882 seek_pending_ = true; |
883 | 883 |
884 // We'll need to pause every filter before seeking. The state transition | 884 // We'll need to pause every filter before seeking. The state transition |
885 // is as follows: | 885 // is as follows: |
886 // kStarted/kEnded | 886 // kStarted/kEnded |
887 // kPausing (for each filter) | 887 // kPausing (for each filter) |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 case kStopping: | 1328 case kStopping: |
1329 case kStopped: | 1329 case kStopped: |
1330 NOTREACHED() << "Unexpected state for teardown: " << state_; | 1330 NOTREACHED() << "Unexpected state for teardown: " << state_; |
1331 break; | 1331 break; |
1332 // default: intentionally left out to force new states to cause compiler | 1332 // default: intentionally left out to force new states to cause compiler |
1333 // errors. | 1333 // errors. |
1334 }; | 1334 }; |
1335 } | 1335 } |
1336 | 1336 |
1337 } // namespace media | 1337 } // namespace media |
OLD | NEW |