shithub: h264bsd

Download patch

ref: 71032b396f78666f6984e8ec2b80f6ee8d5c08f3
parent: 1f7b88ee8623ae809d1ce1cfef188488876fcfa5
author: Matthew Stephure <matt.stephure@calgaryscientific.com>
date: Wed Jan 15 11:59:23 EST 2014

PWEB-4037
Add support for CrossBridge

diff: cannot open b/flex//null: file does not exist: 'b/flex//null'
--- /dev/null
+++ b/flex/Makefile
@@ -1,0 +1,38 @@
+SOURCES = $(wildcard ../src/*.c) main.c
+
+FLASCC:=X
+FLEX:=X
+AS3COMPILER:=asc2.jar
+BASE_CFLAGS:=-Wno-write-strings -Wno-trigraphs -DFLASCC
+
+$?UNAME=$(shell uname -s)
+ifneq (,$(findstring CYGWIN,$(UNAME)))
+	$?nativepath=$(shell cygpath -at mixed $(1))
+	$?unixpath=$(shell cygpath -at unix $(1))
+else
+	$?nativepath=$(abspath $(1))
+	$?unixpath=$(abspath $(1))
+endif
+
+ifneq (,$(findstring "asc2.jar","$(AS3COMPILER)"))
+	$?AS3COMPILERARGS=$(JAVA_HOME)/bin/java $(JVMARGS) -jar $(call nativepath,$(FLASCC)/usr/lib/$(AS3COMPILER)) -merge -md 
+else
+	echo "ASC is no longer supported" ; exit 1 ;
+endif
+
+check:
+	@if [ -d $(FLASCC)/usr/bin ] ; then true ; \
+	else echo "Couldn't locate FLASCC sdk directory, please invoke make with \"make FLASCC=/path/to/FLASCC/sdk ...\"" ; exit 1 ; \
+	fi
+
+	@if [ -d "$(FLEX)/bin" ] ; then true ; \
+	else echo "Couldn't locate Flex sdk directory, please invoke make with \"make FLEX=/path/to/flex  ...\"" ; exit 1 ; \
+	fi
+
+swc: check
+	"$(FLASCC)/usr/bin/gcc" $(BASE_CFLAGS) -O4 $(SOURCES) -emit-swc=h264bsd -o h264bsd.swc
+	"$(FLEX)/bin/mxmlc" -static-link-runtime-shared-libraries -compiler.omit-trace-statements=false -library-path=h264bsd.swc -debug=false h264test.as -o h264test.swf
+
+
+clean:
+	rm -f *.swf *.swc *.bc *.exe
--- /dev/null
+++ b/flex/h264test.as
@@ -1,0 +1,43 @@
+package
+{
+  import flash.display.Sprite;
+  import flash.text.TextField;
+  import flash.events.Event;
+  import h264bsd.CModule;
+  
+  public class h264test extends Sprite
+  {
+    public function h264test()
+    {
+      addEventListener(Event.ADDED_TO_STAGE, initCode);
+    }
+ 
+    public function initCode(e:Event):void
+    {
+      CModule.startAsync(this)
+	  
+	  var ret:int = 0;
+	  var tf:TextField = new TextField
+      tf.multiline = true
+      tf.width = stage.stageWidth
+      tf.height = stage.stageHeight
+      addChild(tf)
+	  
+	  trace("Logging Started...");
+	  
+	  var h264:int = 0;
+	  var args:Vector.<int> = new Vector.<int>;
+      h264 = CModule.callI(CModule.getPublicSymbol("h264bsdAlloc"), args);	  
+	  tf.appendText("h264bsdAlloc ... " + ( h264 != 0 ? "Success" : "Failure") + "\n");
+	  
+	  
+	  args = new <int>[h264,0];
+	  ret = CModule.callI(CModule.getPublicSymbol("h264bsdInit"), args);	  	  
+	  tf.appendText("h264bsdInit ... " + ( ret == 0 ? "Success" : "Failure" + ret) + "\n");  
+	  
+	  args = new <int>[h264];
+	  CModule.callI(CModule.getPublicSymbol("h264bsdShutdown"), args);	  	  
+	  tf.appendText("h264bsdShutdown ... Success\n");  
+    }
+  }
+}
--- /dev/null
+++ b/flex/main.c
@@ -1,0 +1,6 @@
+#include "AS3/AS3.h"
+
+int main()
+{
+     AS3_GoAsync();
+}
\ No newline at end of file
--- a/src/h264bsd_decoder.c
+++ b/src/h264bsd_decoder.c
@@ -42,7 +42,6 @@
 /*------------------------------------------------------------------------------
     1. Include headers
 ------------------------------------------------------------------------------*/
-
 #include "h264bsd_decoder.h"
 #include "h264bsd_nal_unit.h"
 #include "h264bsd_byte_stream.h"
--- a/src/h264bsd_decoder.h
+++ b/src/h264bsd_decoder.h
@@ -35,6 +35,8 @@
 
 #include "basetype.h"
 
+#include "h264bsd_storage.h"
+
 /*------------------------------------------------------------------------------
     2. Module defines
 ------------------------------------------------------------------------------*/
@@ -53,7 +55,7 @@
     3. Data types
 ------------------------------------------------------------------------------*/
 
-typedef struct storage storage_t;
+
 
 /*------------------------------------------------------------------------------
     4. Function prototypes