Android Question VideoRecordApp

gregchao

Member
Licensed User
Longtime User
I cannot seem to get the VideoRecordApp working. I can call it OK but it returns success = false upon completing. Here is the code and unfiltered log.

B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: Portrait
    #CanInstallToExternalStorage: True
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True

#End Region

Sub Process_Globals
    Dim videoRecorder As VideoRecordApp
End Sub

Sub Globals
    Dim vv As VideoView
    Private RecordVideo1 As Button
    Private Panel1 As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("1")
    If FirstTime Then
        videoRecorder.Initialize("videoRecorder")
    End If
    vv.Initialize("vv")
    Activity.AddView(vv, 0, 0, 100%x, 50%y)
End Sub

Sub RecordVideo1_Click
    videoRecorder.Record2(File.DirInternal, "1.mp4", 60)
End Sub

Sub videoRecorder_RecordComplete (Success As Boolean)
    Log("video = " & Success)
    If Success Then
        vv.LoadVideo(File.DirInternal, "1.mp4")
        vv.Play
    End If
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub

B4X:
[CODE]sending message to waiting queue (OnActivityResult)
running waiting messages (1)
Class anywheresoftware.b4a.B4AThreadPool failed lock verification and will run slower.
java.lang.NullPointerException: Attempt to invoke virtual method 'android.net.Uri android.content.Intent.getData()' on a null object reference
** Activity (main) Resume **
    at anywheresoftware.b4a.audio.AudioRecordApp$VideoRecordApp$1$1.run(AudioRecordApp.java:228)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:761)
MSG_WINDOW_FOCUS_CHANGED 1
Starting input: tba=android.view.inputmethod.EditorInfo@a9ce7e2 nm : b4a.example ic=null
[IMM] startInputInner - mService.startInputOrWindowGainedFocus
Input channel constructed: fd=72
video = false
 
Last edited:

ronell

Well-Known Member
Licensed User
Longtime User
CODETAGS.png
 
Upvote 0

gregchao

Member
Licensed User
Longtime User
Thanks for the quick reply! Good idea but it is not the problem. I still get success = false. I occasionally get an additional error. Would this be a clue?


B4X:
mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease()
mAcquireTouchFunc method = public int com.qualcomm.qti.Performance.perfLockAcquireTouch(android.view.MotionEvent,android.util.DisplayMetrics,int,int[])
mIOPStart method = public int com.qualcomm.qti.Performance.perfIOPrefetchStart(int,java.lang.String)
mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop()
BoostFramework() : mPerf = com.qualcomm.qti.Performance@ead7fc3
ViewPostImeInputStage processPointer 1
MSG_WINDOW_FOCUS_CHANGED 0
** Activity (main) Pause, UserClosed = false **
endAllActiveAnimators on 0x7f8bd7a400 (RippleDrawable) with handle 0x7f8bdac540
Input channel destroyed: fd=72
reportFullscreenMode on inexistent InputConnection
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
Class anywheresoftware.b4a.B4AThreadPool failed lock verification and will run slower.
** Activity (main) Resume **
java.lang.NullPointerException: Attempt to invoke virtual method 'android.net.Uri android.content.Intent.getData()' on a null object reference
    at anywheresoftware.b4a.audio.AudioRecordApp$VideoRecordApp$1$1.run(AudioRecordApp.java:228)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:761)
MSG_WINDOW_FOCUS_CHANGED 1
Starting input: tba=android.view.inputmethod.EditorInfo@6f170b1 nm : b4a.example ic=null
[IMM] startInputInner - mService.startInputOrWindowGainedFocus
Input channel constructed: fd=74
video = false
Log reader error: java.io.InterruptedIOException: read interrupted
-1 received
writer error
java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2010)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2044)
    at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:358)
    at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
    at java.lang.Thread.run(Thread.java:761)
Starting remote logger. Port: 35352
After accept
 
Upvote 0

gregchao

Member
Licensed User
Longtime User
I tried yet a third default video app with success!!! Thanks for your help. FYI, it is called "CameraMX."
 
Upvote 0
Top