A video playing apparatus, comprising:
- an obtaining module, configured for obtaining to-be-played video frames;
- a first input decoding module, configured for inputting the obtained to-be-played video frames into a preset decoder, and decoding the to-be-played video frames by the preset decoder to obtain decoded to-be-played video frames;
- a storage module, configured for storing the decoded to-be-played video frames as texture data in a local texture storage area of a graphic processing unit;
- a determining module, configured for determining, from the decoded to-be-played video frames stored in the texture storage area, a decoded to-be-played video frame that satisfies a rendering condition as a to-be-rendered video frame;
- a rendering and playing module, configured for rendering the determined to-be-rendered video frame by the graphic processing unit and playing a rendered video frame;
- wherein, the rendering condition is that, the decoded to-be-played video frame has an earliest timestamp among timestamps that are subsequent to a timestamp for an audio frame that is currently being played,
- wherein, the apparatus further comprises a second judging module, a constructing module, a second input decoding module, and a stopping module;
- wherein:
- the second judging module is configured for, before obtaining to-be-played video frames, determining whether a second jump instruction is received, wherein the second jump instruction is an instruction for instructing the preset decoder to complete decoding of currently obtained video frames and then to perform a jump of video playing, and the second jump instruction contains a second moment to which the video playing is required to jump;
- the constructing module is configured for constructing, after determining that the second jump instruction is received, a useless video frame as a useless frame;
- the second input decoding module is configured for inputting circularly the constructed useless video frame into the preset decoder, and decoding the currently obtained video frames and the useless video frame through the preset decoder;
- and
- the stopping module is configured for stopping the input of the constructed useless video frame into the preset decoder once a decoded useless video frame is obtained or a target video frame is obtained, wherein the target video frame is a video frame with the largest timestamp among the currently obtained video frames;
- and
- the obtaining module is further configured for:
- obtaining, from a target video file, a video frame having a timestamp corresponding to the second moment contained in the second jump instruction as a to-be-played video frame.