![]() ![]() We'll see why we need to convert this value later. avcodec defaults to a value of 1,000,000 fps (so a pos of 2 seconds will be timestamp of 2000000). Recall that timestamps in streams are measured in frames rather than seconds, with the formula seconds = frames * time_base (fps). We convert our new time to avcodec's internal timestamp unit. 6U 900 mm Open Frame Rack WOS 600mm and 900mm 4-post open frame racks are. Then we call a stream_seek function to set the seek_pos, etc., values. Shop undefined iStar AV ISTR-WOS-690 6U 900 mm Open Frame Rack at. Once we know which way we want to seek, we calculate the new time by adding the increment to the value from our new get_master_clock function. Then we check and see which key got hit using. To detect keypresses, we first look and see if we get an SDL_KEYDOWN event. Pos = get_master_clock(global_video_state) Now we need to set up our main loop to catch the key presses: avframealloc doesnt do anything other than allocate the AVFrame struct and initialize it to some default values. So instead, we're going to add some values to the big struct that will contain the new position to seek to and some seeking flags: We have to do that in our main decode loop, the decode_thread loop. ![]() However, when we do get a keystroke, we can't call av_seek_frame directly. So we need to set up our main loop so it catches the keystrokes. We're going to make the left and right arrows go back and forth in the movie by a little and the up and down arrows a lot, where "a little" is 10 seconds, and "a lot" is 60 seconds. Plus, this will show you how easy the av_seek_frame function is to use. Now we're going to add some seeking capabilities to our player, because it's really annoying when you can't rewind a movie. Code: tutorial07.c Handling the seek command Harolds Frame Shop Inc is a local, family owned and operated company that has been in business since 1949. ![]()
0 Comments
Leave a Reply. |