[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Correction on last e-mail....



That's a different matter.  I added the method "is-hardware-encode" to
determine which open to call since the open needs to do different
things.  I'll bet that I didn't add the hwopen method to the code and I
may not have put the default method for is-hardware-decode on
VideoCapture.  And, now that I think about it, we probably want to put
the test at the front of open.  Do you want to fix it?  Here's the code
I was using for hwopen in my mjpeg tests:
---
VideoPipeline instproc hwopen { device format } {
        $self instvar tap_ encoder_ format_ bufferPool_ session_
quality_
        $self instvar initialized_
        $tap_ release
        puts "Entered VideoPipeline::hwopen(device=$device,
format=$format)"

        set format_ $format
        if {$format != "jpeg"} {
                return "LML33JPEG only encodes jpeg"
        }

        set framer [new Module/Framer/JPEG]
        $framer mtu [$self get_option mtu]
        if ![info exists bufferPool_] {
                set bufferPool_ [new BufferPool/RTP]
                $bufferPool_ srcid [$session_ get_local_srcid]
        }
        $framer buffer-pool $bufferPool_
        $framer target [$session_ get_transmitter]

        set err [$tap_ open $device 422p]
        if { $err != "" } {
                return $err
        }
        set initialized_ 1

        $tap_ target $framer $framer
        $tap_ set decimate_ 1

        $self set_quality $quality_

        return ""
}
---
If you don't want to do it, change the code below to take out the hwopen
and I'll clean it up.
	Larry

atthew Delco wrote:
> 
> In my last e-mail I identified the wrong piece of code.  The problem
> instead appears to be with VideoPipeline.start, which has an update that
> replaces:
> 
> set err [$self open $device_ $format_]
> 
> with:
> 
>             if { [$device_ is-hardware-encode] } {
>                 set err [$self hwopen $device_ $format_]
>             } else {
>                 set err [$self open $device_ $format_]
>             }
> 
> MD

-- 
Professor Lawrence A. Rowe          Internet:  Rowe@BMRC.Berkeley.EDU
Computer Science Division - EECS       Phone: 510-642-5117
University of California, Berkeley       Fax: 510-642-5615
Berkeley, CA 94720-1776            URL: http://bmrc.berkeley.edu/~larry