Skip to content

Instantly share code, notes, and snippets.

MediaSource::ReadOptions options;
int64_t thumbNailTime;
if (trackMeta->findInt64(kKeyThumbnailTime, &thumbNailTime)) {
options.setSeekTo(thumbNailTime);
} else {
thumbNailTime = -1;
}
mCodecInputBuffers = mCodec.getInputBuffers();
mCodecOutputBuffers = mCodec.getOutputBuffers();
mCodecInputBuffers = mCodec.getInputBuffers();
mCodecOutputBuffers = mCodec.getOutputBuffers();
function cksLongestPlateau(data) {
var length = 1;
for (var i = 1; i < data.length; ++i) {
if (data[i] == data[i - length])
++length;
}
return length;
}
@kswlee
kswlee / gist:3183078
Created July 26, 2012 16:30
Run tests that need a body at doc ready
// Run tests that need a body at doc ready
jQuery(function() {
var container, outer, inner, table, td, offsetSupport,
marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
paddingMarginBorderVisibility, paddingMarginBorder,
body = document.getElementsByTagName("body")[0];
if ( !body ) {
// Return for frameset docs that don't have a body
return;
@kswlee
kswlee / gist:3182851
Created July 26, 2012 15:51
jQuery.Callbacks
/*
* Create a callback list using the following parameters:
*
* flags: an optional list of space-separated flags that will change how
* the callback list behaves
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
* Possible flags:
@kswlee
kswlee / gist:3182736
Created July 26, 2012 15:32
jQuery ready and bindReady
ready: function( fn ) {
// Attach the listeners
jQuery.bindReady();
// Add the callback
readyList.add( fn );
return this;
}
@kswlee
kswlee / gist:3182346
Created July 26, 2012 14:24
jQuery init function (partial)
init: function( selector, context, rootjQuery ) {
var match, elem, ret, doc;
// Handle $(""), $(null), or $(undefined)
if ( !selector ) {
return this;
}
// Handle $(DOMElement)
if ( selector.nodeType ) {
@kswlee
kswlee / gist:3182301
Created July 26, 2012 14:18
jQuery init function (partial)
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
}
@kswlee
kswlee / gist:3182106
Created July 26, 2012 13:46
jQuery ready funciton
//... skipped ...
ready: function( fn ) {
// Attach the listeners
jQuery.bindReady();
// Add the callback
readyList.add( fn );
return this;
},