Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Side by Side Diff: Source/platform/ContentType.cpp

Issue 1283573002: Do the codec string parsing for MSE in media, instead of Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/platform/ContentType.h ('k') | public/platform/WebMediaSource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * Copyright (C) 2009 Google Inc. All rights reserved. 4 * Copyright (C) 2009 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 String strippedType = m_type.stripWhiteSpace(); 69 String strippedType = m_type.stripWhiteSpace();
70 70
71 // "type" can have parameters after a semi-colon, strip them 71 // "type" can have parameters after a semi-colon, strip them
72 size_t semi = strippedType.find(';'); 72 size_t semi = strippedType.find(';');
73 if (semi != kNotFound) 73 if (semi != kNotFound)
74 strippedType = strippedType.left(semi).stripWhiteSpace(); 74 strippedType = strippedType.left(semi).stripWhiteSpace();
75 75
76 return strippedType; 76 return strippedType;
77 } 77 }
78 78
79 Vector<String> ContentType::codecs() const
80 {
81 String codecsParameter = parameter("codecs");
82
83 if (codecsParameter.isEmpty())
84 return Vector<String>();
85
86 Vector<String> codecs;
87 codecsParameter.split(',', codecs);
88 for (size_t i = 0; i < codecs.size(); ++i)
89 codecs[i] = codecs[i].simplifyWhiteSpace();
90
91 return codecs;
92 }
93
94 } // namespace blink 79 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/ContentType.h ('k') | public/platform/WebMediaSource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698