#navi(contents-page-name): No such page: Vweb

SDKを読んでみる

VWeb VW2010 WIN32 SDK2の使い方

フォーマット推奨設定
MPEG-1TS 352x240 1.5Mbps
MPEG-2TS 704x480 3.0Mbps
MPEG-4TS 704x480 1.0Mbps

vwSDK_ConfigUtil.h

class ConfigParser

ホスト名とポート番号がそれぞれ127.0.0.1と5001で固定。 コンストラクタ初期化子で設定されている。

とりあえずハードコーディング。よい子はまねしないように。

ConfigParser(IMPL_CLASS *p_hw):pHW_m(p_hw), mode_m(INVALID_CONTROL_MODE),
       streamType_m(INVALID_STREAM_TYPE), numFirmware_m(0), 
       pickedConfig_mux_m(NULL), pickedConfig_demux_m(NULL),
       lengthOfEncode_m(INVALID_TIME_LENGTH),marFreq_m(10),
               signalType_m(NTSC),mpegType_m(MPEG1),cBufMode_m(FALSE),
       psIndex_m(FALSE),fixedPattern_m(FALSE),doNetwork_m(TRUE),
               doMulticast_m(FALSE),port_m(5001),xferTimeout_m(1),xferNPage_m(6) 
   {
       strcpy(hostname_m, "192.168.100.10");
   }
# cd driver_linux
# modload

net_send on x86

% ./net_send option_files/enc_mp2ts_ntsc_01m.ini video_input_device=0xc40242
[ Vweb VW2010 SDK2 Network Encoder v2.50 ]
[ NET_ENCODER ]      -> Compiled on: [Jan 17 2005 17:39:26]
[ vwSDK.so ]         -> Compiled on: [Jan  7 2005 20:10:25]

=> setMsgLevel set to 1
openDevice("/dev/vw2010/vw2010_00") board #0 succeeded, handle=00000003
Clock Frequency has been set to [162 Mhz]
=> Putting VW2010 Board #0 in Reset Mode...success!
=> Resetting Encoder...success!
=> Resetting Decoder...success!
=> Resetting Signature...Success!
=> Reset Driver handles board #0
=> VW2010 chip detected
=> VW2010 PCI Driver Version = 0x20041113
length of encode is 2147483647
transfer timeout is 5
single transfer is 8 pages
setConfigParam [video_input_device=0xc40242]
=> FW Download: [boot.sre] succeeded!
=> FW Verify: [boot.sre] succeeded!
=> FW Download: [tscodec.sre] succeeded!
=> FW Verify: [tscodec.sre] succeeded!
starting MIPS
checking MIPS
> MIPs microcode initialization succeeded!
=> Firmware running!
=> Firmware is Running!
XFERSIZE(0): bitrate      = 1000000
XFERSIZE(0): video_format = NTSC
XFERSIZE(0): xfer_size    = 4096
Transfer Size is 4096
 => TSMUX Firmware Version 0x01041117
Firmware version # = 17043735 [0x01041117]
--- Read Thread created!
Hit 'q' to stop, other keys are ignored
VW_SetVideoInputSource <- Composite input
setupDevice() <Transport Stream MUX>
setting (0x0102) output_bit_rate                = ( 0        [0x00000000] )
setting (0x0105) top_output_device              = ( 0        [0x00000000] )
setting (0x011F) no_psi                         = ( 0        [0x00000000] )
setting (0x0120) pat_rate                       = ( 100      [0x00000064] )
setting (0x0124) pmt_pid                        = ( 32       [0x00000020] )
setting (0x0125) pmt_rate                       = ( 400      [0x00000190] )
setting (0x0129) pcr_pid                        = ( 37       [0x00000025] )
setting (0x012B) video_pid                      = ( 33       [0x00000021] )
setting (0x012D) audio1_pid                     = ( 34       [0x00000022] )
setting (0x012E) audio2_pid                     = ( 0        [0x00000000] )
setting (0x0131) user_data_pid                  = ( 36       [0x00000024] )
setting (0x0147) user_data_allocation           = ( 8        [0x00000008] )
setting (0x0148) user_data                      = set 17 INT32 array elements
setting (0x0165) video_pes_alignment            = ( 1        [0x00000001] )
setting (0x0185) audio_pes_alignment            = ( 1        [0x00000001] )
setting (0x0200) vid_aspect_ratio_information   = ( 2        [0x00000002] )
setting (0x0201) vid_frame_rate_code            = ( 4        [0x00000004] )
setting (0x0202) gop_structure                  = set 2 INT16 array elements
setting (0x0203) video_horizontal_size          = ( 352      [0x00000160] )
setting (0x0204) video_vertical_size            = ( 480      [0x000001E0] )
setting (0x0205) video_bit_rate                 = ( 1000000  [0x000F4240] )
setting (0x0206) video_vbv_buffer_size          = ( 0        [0x00000000] )
setting (0x0222) vid_vbr                        = ( 0        [0x00000000] )
setting (0x0223) vid_average_bit_rate           = ( 4000000  [0x003D0900] )
setting (0x0224) vid_I_max_min_Q                = ( 65536    [0x00010000] )
setting (0x0225) vid_BP_max_min_Q               = ( 0        [0x00000000] )
setting (0x0209) sequence_header_rate           = ( 1        [0x00000001] )
setting (0x020A) video_format                   = ( 2        [0x00000002] )
setting (0x020A) vid_video_format               = ( 2        [0x00000002] )
setting (0x020E) mpeg_coding_standard           = ( 2        [0x00000002] )
setting (0x020F) telecine_mode                  = ( 1        [0x00000001] )
setting (0x0212) frame_mode                     = ( 0        [0x00000000] )
setting (0x0213) scene_detection                = ( 0        [0x00000000] )
setting (0x0214) low_delay                      = ( 0        [0x00000000] )
setting (0x0215) vertical_offset                = ( 0        [0x00000000] )
setting (0x0216) horizontal_cutoff              = ( 0        [0x00000000] )
setting (0x0217) vertical_cutoff                = ( 0        [0x00000000] )
setting (0x021A) horizontal_start_pos           = ( -1       [0xFFFFFFFF] )
setting (0x021B) vertical_start_pos             = ( -1       [0xFFFFFFFF] )
setting (0x021C) mpeg4_quant_type               = ( 1        [0x00000001] )
setting (0x021D) short_header                   = ( 0        [0x00000000] )
setting (0x021E) vid_mpeg4_VOS                  = ( 0        [0x00000000] )
setting (0x021F) vid_mpeg4_constant_vbv         = ( 0        [0x00000000] )
setting (0x0232) vid_closed_gop                 = ( 1        [0x00000001] )
setting (0x0300) audio_layer                    = ( 2        [0x00000002] )
setting (0x0301) audio_sampling_rate            = ( 48000    [0x0000BB80] )
setting (0x0302) audio_channel                  = ( 0        [0x00000000] )
setting (0x0303) audio_bit_rate                 = ( 10       [0x0000000A] )
setting (0x0304) audio_error_protection         = ( 0        [0x00000000] )
setting (0x0305) external_audio_clock           = ( 2        [0x00000002] )
setting (0x0404) chroma_saturation              = ( 68       [0x00000044] )
setting (0x0405) chroma_hue                     = ( 0        [0x00000000] )
setting (0x040F) video_input_device             = ( 12845634 [0x00C40242] )
setting (0x0420) gpio_configuration             = ( 16711680 [0x00FF0000] )
setting (0x0421) gpio_access                    = ( 0        [0x00000000] )
setting (0x0430) vbi_cc                         = set 3 INT32 array elements
setting (0x0501) test_mode                      = ( 0        [0x00000000] )
setting (0x0502) initial_timecode               = ( 0        [0x00000000] )
setting (0x0503) initial_pcr                    = ( 0        [0x00000000] )
setting (0x0504) sync_to_video                  = ( 0        [0x00000000] )
setting (0x0505) cdo_clock                      = ( 4096     [0x00001000] )
setting (0x0507) mpeg_stream_type               = ( 0        [0x00000000] )
setting (0x1003) write_fifo_address             = ( 12583680 [0x00C00300] )
setting (0x1002) read_fifo_address              = ( 12583936 [0x00C00400] )
configureI2CTable(): sending I2C Table # 3
=> Video Detected!
I2C_GetVideoFormat - <NTSC> detected from 7115
-> Networking Enabled
init_udp_sender() - connecting to 192.168.100.10
Starting MUX device...
net_encoder_thread startReadDevice() success!
++++++++++++++++++++++++++++++++++++++++++q+++++++User hitstopping program
+
Stopping MUX device...
net_encoder_thread() stopped read device successfully
deinit_udp_sender()

なにかUDPで送っているようだ。

net_recv on x86

hasebe@espresso:SDK2% ./net_recv option_files/dec_mp2ts_ntsc.ini
[ Vweb VW2010 SDK2 Network Decoder v2.50 ]
[ NET_DECODER ]      -> Compiled on: [Jan 17 2005 17:39:22]
[ vwSDK.so ]         -> Compiled on: [Jan  7 2005 20:10:25]

=> setMsgLevel set to 1
openDevice("/dev/vw2010/vw2010_00") board #0 succeeded, handle=00000003
=> Putting VW2010 Board #0 in Reset Mode...success!
=> Resetting Encoder...success!
=> Resetting Decoder...success!
=> Resetting Signature...Success!
=> Reset Driver handles board #0
=> VW2010 chip detected
=> PCI Driver Version = 0x20041113
transfer timeout is 5
single transfer is 8 pages
=> FW Download: [boot.sre] succeeded!
=> FW Verify: [boot.sre] succeeded!
=> FW Download: [tscodec.sre] succeeded!
=> FW Verify: [tscodec.sre] succeeded!
starting MIPS
checking MIPS
> MIPs microcode initialization succeeded!
=> Firmware running!
=> Firmware is Running!
=> TSDEMUX Firmware version N/A
Firmware version # = 0 [0x00000000]
Transfer Size is 32712
--- network_read_thread() created!
init_udp_receiver() - connecting to 192.168.100.10
--- decode_thread() created!
setupDevice() <Transport Stream DEMUX>
Send reset cmd... 
setting (0x020A) video_format                   = ( 1        [0x00000001] )
setting (0x020E) mpeg_coding_standard           = ( 2        [0x00000002] )
setting (0x020F) loopback_mode                  = ( 0        [0x00000000] )
setting (0x0001) bypass_mode                    = ( 0        [0x00000000] )
setting (0x0020) preview_mode                   = ( 0        [0x00000000] )
setting (0x0003) input_device                   = ( 3        [0x00000003] )
setting (0x0013) serial_cdi_endianess           = ( 1        [0x00000001] )
setting (0x0021) auto_demux                     = ( 1        [0x00000001] )
setting (0x001E) pci_endianess                  = ( 1        [0x00000001] )
setting (0x001F) bit_rate                       = ( 20000000 [0x01312D00] )
setting (0x1003) demux_write_fifo_address       = ( 12586752 [0x00C00F00] )
setting (0x1002) demux_read_fifo_address        = ( 12583424 [0x00C00200] )
setting (0x000E) play_back_prog_num             = ( 0        [0x00000000] )
setting (0x0004) pmt_pid                        = ( 0        [0x00000000] )
setting (0x0005) nit_pid                        = ( 0        [0x00000000] )
setting (0x0006) private_data_pid               = ( 0        [0x00000000] )
setting (0x0038) video_pid                      = ( 0        [0x00000000] )
setting (0x0030) audio1_pid                     = ( 0        [0x00000000] )
setting (0x0031) audio2_pid                     = ( 0        [0x00000000] )
setting (0x0010) pcr_pid                        = ( 0        [0x00000000] )
setting (0x0018) user_pid1                      = ( 0        [0x00000000] )
setting (0x0019) user_pid2                      = ( 0        [0x00000000] )
setting (0x001A) user_pid3                      = ( 0        [0x00000000] )
setting (0x001B) user_pid1_mask                 = ( 0        [0x00000000] )
setting (0x001C) user_pid2_mask                 = ( 0        [0x00000000] )
setting (0x001D) user_pid3_mask                 = ( 0        [0x00000000] )
setting (0x003C) av_sync                        = ( 1        [0x00000001] )
setting (0x0210) short_header                   = ( 0        [0x00000000] )
setting (0x0220) vsync_output_gpio              = ( 0        [0x00000000] )
setting (0x0050) audio_delay                    = ( 0        [0x00000000] )
setting (0x005A) Video_output_config            = set 3 INT32 array elements
setting (0x005B) Video_aspect_ratio             = ( 0        [0x00000000] )
setting (0x0420) gpio_configuration             = ( 16711680 [0x00FF0000] )
setting (0x0421) gpio_access                    = ( 0        [0x00000000] )
setting (0x0031) av_sync                        = ( 1        [0x00000001] )
setting (0x0507) fixed_pattern                  = ( 0        [0x00000000] )
setting (0x003F) stop_background_color          = ( 49       [0x00000031] )
setting (0x0040) decoder_pwm                    = ( 0        [0x00000000] )
setting (0x0041) underflow_background_color     = ( 49       [0x00000031] )
setting (0x0043) flush_before_stop              = ( 0        [0x00000000] )
setting (0x0044) timeout_to_show_background     = ( 2        [0x00000002] )
setting (0x0045) fast_restart                   = ( 0        [0x00000000] )
setting (0x003E) clock_recovery                 = ( 1        [0x00000001] )
setting (0x0046) audio_dual_mono                = ( 0        [0x00000000] )
setting (0x0047) audio_mute                     = ( 0        [0x00000000] )
configureI2CTable(): sending I2C Table # 5
Starting DEMUX device...
decode_thread startWriteDevice() success! 

受信側も動いているようだ。

同じPCで両方いっぺんに動かすと片方が異常終了。

net_send.cpp

THREAD_RETURN THREAD_API net_encoder_thread(LPVOID p_capture_param) {
  init_udp_sender( p_param->Hostname, p_param->Port, p_network_info, p_param->doMulticast );

  while (!signal_quit)
     udp_send_data( (char*)p_buf, read_size, p_network_info );
}
int main(int argc,char *argv[]) {
  start_thread(net_encoder_thread_struct, &capture_param, &net_encoder_thread);
}

net_recv.cpp

THREAD_RETURN THREAD_API network_read_thread(LPVOID p_threadParam) {
   init_udp_receiver( p_param->Hostname, p_param->Port, &ni, p_param->doMulticast )

   while (!signal_quit)
      read_network_data( in_buf, p_param, &ni, 1);
   
}
int main(int argc,char *argv[]) {
   start_thread(network_thread_struct, &network_reader_param, &network_read_thread);
}

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS