Skip to content

Commit

Permalink
Update issue #302 : Added support for creating content or reference r…
Browse files Browse the repository at this point in the history
…ecordings to Stream Buffer Sink property page

Added event logging for Stream Buffer Engine Events (normal DirectShow events, not the newer style IBroadcastEvent events)
  • Loading branch information
mikecopperwhite committed Feb 28, 2017
1 parent 79762be commit 55d4211
Show file tree
Hide file tree
Showing 7 changed files with 281 additions and 55 deletions.
38 changes: 32 additions & 6 deletions graphstudionext.rc
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,30 @@ BEGIN
CONTROL "",IDC_TITLEBAR,"Static",SS_OWNERDRAW,0,0,301,21
END

IDD_PROPPAGE_STREAMBUFFERSINK DIALOGEX 0, 0, 272, 248
IDD_PROPPAGE_STREAMBUFFERSINK DIALOGEX 0, 0, 272, 226
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
CONTROL "",IDC_TITLEBAR,"Static",SS_OWNERDRAW,0,0,272,20
GROUPBOX "Sink",IDC_STATIC,2,23,267,52
COMBOBOX IDC_COMBO_FILE,7,36,201,138,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Browse ...",IDC_BUTTON_BROWSE,214,36,50,14
PUSHBUTTON "Lock Profile",IDC_BUTTON_LOCK,214,54,50,14
GROUPBOX "Profile",IDC_STATIC,2,23,267,55
COMBOBOX IDC_COMBO_FILE,7,36,197,138,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Browse ...",IDC_BUTTON_BROWSE,210,36,50,14
PUSHBUTTON "Lock profile",IDC_BUTTON_LOCK,6,54,66,14
GROUPBOX "Recording (optional)",IDC_STATIC,0,84,267,72
COMBOBOX IDC_COMBO_RECORDING_FILE,6,96,193,138,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Browse ...",IDC_BUTTON_RECORDING_BROWSE,210,96,50,14
CONTROL "Reference recording (content recording if deselected)",IDC_CHECK_REFERENCE_RECORDING,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,114,192,10
LTEXT "Start time (in seconds)",IDC_STATIC_START_TIME,78,174,90,12
EDITTEXT IDC_EDIT_START_TIME,6,174,66,14,ES_AUTOHSCROLL | ES_NUMBER
PUSHBUTTON "Stop recording",IDC_BUTTON_STOP_RECORDING,192,192,66,12
PUSHBUTTON "Create recording",IDC_BUTTON_CREATE_RECORDING,6,132,66,12
PUSHBUTTON "Start recording",IDC_BUTTON_START_RECORDING,192,174,66,12
PUSHBUTTON "Close recording",IDC_BUTTON_CLOSE_RECORDING,84,132,66,12
LTEXT "Stop time (in seconds)",IDC_STATIC_STOP_TIME,78,192,90,12
EDITTEXT IDC_EDIT_STOP_TIME,6,192,66,14,ES_AUTOHSCROLL | ES_NUMBER
PUSHBUTTON "Unlock profile",IDC_BUTTON_UNLOCK,84,54,66,14
GROUPBOX "Recording control",IDC_STATIC,5,162,259,54
END

IDD_DIALOG_SBECONFIG DIALOGEX 0, 0, 294, 113
Expand Down Expand Up @@ -930,7 +945,7 @@ BEGIN
IDD_PROPPAGE_STREAMBUFFERSINK, DIALOG
BEGIN
RIGHTMARGIN, 173
BOTTOMMARGIN, 127
BOTTOMMARGIN, 105
END

IDD_DIALOG_SBECONFIG, DIALOG
Expand Down Expand Up @@ -1453,6 +1468,17 @@ BEGIN
END


/////////////////////////////////////////////////////////////////////////////
//
// AFX_DIALOG_LAYOUT
//

IDD_PROPPAGE_STREAMBUFFERSINK AFX_DIALOG_LAYOUT
BEGIN
0
END


/////////////////////////////////////////////////////////////////////////////
//
// String Table
Expand Down
20 changes: 16 additions & 4 deletions resource.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Von Microsoft Visual C++ generierte Includedatei.
// Verwendet durch graphstudionext.rc
// Microsoft Visual C++ generated include file.
// Used by graphstudionext.rc
//
#define IDC_BUTTON_SET_PREROLL 3
#define IDD_ABOUTBOX 100
Expand Down Expand Up @@ -93,6 +93,7 @@
#define IDC_SLIDER_SEEK 1016
#define IDC_SLIDER_VOLUME 1016
#define IDC_SLIDER_IRATE 1016
#define IDC_BUTTON_UNLOCK 1016
#define IDC_STATIC_TIME 1017
#define IDC_SLIDER_BALANCE 1017
#define IDC_SLIDER_PRATE 1017
Expand All @@ -104,6 +105,7 @@
#define IDC_BUTTON_SET 1018
#define IDC_EDIT_DETAILS 1019
#define IDC_BUTTON_DEF_PRATE 1019
#define IDC_BUTTON_RECORDING_BROWSE 1019
#define IDC_COMBO_REPORTTYPE 1020
#define IDC_RADIO_FILE 1021
#define IDC_RADIO_URL 1022
Expand All @@ -112,6 +114,7 @@
#define IDC_BUTTON_DEF_QUALITY 1023
#define IDC_COMBO_URL 1024
#define IDC_SLIDER_WINDOW 1024
#define IDC_COMBO_RECORDING_FILE 1024
#define IDC_TAB_PAGES 1025
#define IDC_BUTTON_DEF_WINDOW 1025
#define IDC_TITLEBAR 1027
Expand Down Expand Up @@ -276,8 +279,17 @@
#define IDC_BUTTON_CLEAR_LOG 1166
#define IDC_BUTTON_SPY_PROPERTYFRAME 1167
#define ID_VIEW_COPYSCREENSHOTTOCLIPBOARD 1168
#define IDC_CHECK_REFERENCE_RECORDING 1168
#define ID_VIEW_COPYTEXTTOCLIPBOARD 1169
#define ID_VIEW_COPYSPYTEXTTOCLIPBOARD 1170
#define IDC_EDIT_START_TIME 1170
#define IDC_BUTTON_STOP_RECORDING 1171
#define IDC_BUTTON_CREATE_RECORDING 1172
#define IDC_BUTTON_START_RECORDING 1173
#define IDC_BUTTON_CLOSE_RECORDING 1174
#define IDC_STATIC_START_TIME 1175
#define IDC_STATIC_STOP_TIME 1176
#define IDC_EDIT_STOP_TIME 1177
#define ID_LIST_MRU_CLEAR 4999
#define ID_LIST_MRU_FILE0 5000
#define ID_AUDIO_SOURCE0 6000
Expand Down Expand Up @@ -453,9 +465,9 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 182
#define _APS_NEXT_RESOURCE_VALUE 185
#define _APS_NEXT_COMMAND_VALUE 32964
#define _APS_NEXT_CONTROL_VALUE 1167
#define _APS_NEXT_CONTROL_VALUE 1176
#define _APS_NEXT_SYMED_VALUE 108
#endif
#endif
11 changes: 11 additions & 0 deletions src/EventsForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,17 @@ void CEventsForm::OnGraphEvent(long evcode, LONG_PTR param1, LONG_PTR param2)
msg = _T("EC_WMT_INDEX_EVENT");
}
break;
case STREAMBUFFER_EC_TIMEHOLE: msg.Format(_T("STREAMBUFFER_EC_TIMEHOLE: start %dms, length %dms"), (int)param1, (int)param2); break;
case STREAMBUFFER_EC_STALE_DATA_READ: msg = _T("STREAMBUFFER_EC_STALE_DATA_READ"); break;
case STREAMBUFFER_EC_STALE_FILE_DELETED: msg = _T("STREAMBUFFER_EC_STALE_FILE_DELETED"); break;
case STREAMBUFFER_EC_CONTENT_BECOMING_STALE: msg = _T("STREAMBUFFER_EC_CONTENT_BECOMING_STALE"); break;
case STREAMBUFFER_EC_WRITE_FAILURE: msg = _T("STREAMBUFFER_EC_WRITE_FAILURE"); break;
case STREAMBUFFER_EC_WRITE_FAILURE_CLEAR: msg = _T("STREAMBUFFER_EC_WRITE_FAILURE_CLEAR"); break;
case STREAMBUFFER_EC_READ_FAILURE: msg.Format(_T("STREAMBUFFER_EC_READ_FAILURE (hr = 0x%08x)"), (HRESULT)param1); break;
case STREAMBUFFER_EC_RATE_CHANGED: msg.Format(_T("STREAMBUFFER_EC_RATE_CHANGED old rate %.3f, new rate %.3f"), param1/1000.0, param2/1000.0); break;
case STREAMBUFFER_EC_PRIMARY_AUDIO: msg = _T("STREAMBUFFER_EC_PRIMARY_AUDIO"); break;
case STREAMBUFFER_EC_RATE_CHANGING_FOR_SETPOSITIONS: msg.Format(_T("STREAMBUFFER_EC_RATE_CHANGING_FOR_SETPOSITIONS old rate %.3f, new rate %.3f"), param1/1000.0, param2/1000.0); break;
case STREAMBUFFER_EC_SETPOSITIONS_EVENTS_DONE: msg = _T("STREAMBUFFER_EC_SETPOSITIONS_EVENTS_DONE"); break;
default:
{
msg.Format(_T("Event Code = 0x%08x"), evcode);
Expand Down
5 changes: 4 additions & 1 deletion src/PropertyForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,13 @@ int CPropertyForm::AnalyzeObject(IUnknown *obj)
}
vfw_dialogs = NULL;

// We pass in the filter object which stores the SBE recorder object
GraphStudio::Filter * const graph_filter = view->graph.FindFilter(filter);

// Internal Property Pages
CComQIPtr<IStreamBufferSink> sbeSink = obj;
if(sbeSink)
AddPropertyPage(new CSbeSinkPage(NULL, &hr, _T("SbeSink")), obj);
AddPropertyPage(new CSbeSinkPage(NULL, &hr, _T("SbeSink"), graph_filter), obj);

// Add Analyzer page via GetPages for CLSID and CoCreateInstance instead
//CComQIPtr<IAnalyzerCommon> analyzer = obj;
Expand Down
Loading

0 comments on commit 55d4211

Please sign in to comment.