This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.afcat.channel.webviewtest; | |
import android.graphics.Color; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.ViewGroup; | |
import android.webkit.WebResourceRequest; | |
import android.webkit.WebView; | |
import android.webkit.WebViewClient; | |
import android.widget.TextView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
app = express(); | |
app.use( function(req, res, next) { | |
res.header('Access-Control-Allow-Origin', '*'); | |
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS'); | |
res.header('Access-Control-Allow-Headers', 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept'); | |
next(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) parseBuffer:(CMSampleBufferRef) sampleBuffer | |
{ | |
CVImageBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); | |
CVPixelBufferLockBaseAddress( pixelBuffer, 0 ); | |
//Processing here | |
int bufferWidth = CVPixelBufferGetWidth(pixelBuffer); | |
int bufferHeight = CVPixelBufferGetHeight(pixelBuffer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a UIImage from sample buffer data | |
- (UIImage *) imageFromSampleBuffer:(CMSampleBufferRef) sampleBuffer | |
{ | |
// Get a CMSampleBuffer's Core Video image buffer for the media data | |
CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); | |
// Lock the base address of the pixel buffer | |
CVPixelBufferLockBaseAddress(imageBuffer, 0); | |
// Get the number of bytes per row for the pixel buffer |