Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: content/common/gpu/media/video_decode_accelerator_unittest.cc

Issue 1745903002: Introduce GpuVideoDecodeAcceleratorFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // The bulk of this file is support code; sorry about that. Here's an overview 5 // The bulk of this file is support code; sorry about that. Here's an overview
6 // to hopefully help readers of this code: 6 // to hopefully help readers of this code:
7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or
8 // Win/EGL. 8 // Win/EGL.
9 // - ClientState is an enum for the state of the decode client used by the test. 9 // - ClientState is an enum for the state of the decode client used by the test.
10 // - ClientStateNotification is a barrier abstraction that allows the test code 10 // - ClientStateNotification is a barrier abstraction that allows the test code
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "base/synchronization/condition_variable.h" 43 #include "base/synchronization/condition_variable.h"
44 #include "base/synchronization/lock.h" 44 #include "base/synchronization/lock.h"
45 #include "base/synchronization/waitable_event.h" 45 #include "base/synchronization/waitable_event.h"
46 #include "base/thread_task_runner_handle.h" 46 #include "base/thread_task_runner_handle.h"
47 #include "base/threading/thread.h" 47 #include "base/threading/thread.h"
48 #include "build/build_config.h" 48 #include "build/build_config.h"
49 #include "content/common/gpu/media/fake_video_decode_accelerator.h" 49 #include "content/common/gpu/media/fake_video_decode_accelerator.h"
50 #include "content/common/gpu/media/rendering_helper.h" 50 #include "content/common/gpu/media/rendering_helper.h"
51 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" 51 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h"
52 #include "content/public/common/content_switches.h" 52 #include "content/public/common/content_switches.h"
53 #include "content/public/common/gpu_video_decode_accelerator_factory.h"
53 #include "media/filters/h264_parser.h" 54 #include "media/filters/h264_parser.h"
54 #include "testing/gtest/include/gtest/gtest.h" 55 #include "testing/gtest/include/gtest/gtest.h"
55 #include "ui/gfx/codec/png_codec.h" 56 #include "ui/gfx/codec/png_codec.h"
56 #include "ui/gl/gl_image.h" 57 #include "ui/gl/gl_image.h"
57 58
58 #if defined(OS_WIN) 59 #if defined(OS_WIN)
59 #include "base/win/windows_version.h" 60 #include "base/win/windows_version.h"
60 #include "content/common/gpu/media/dxva_video_decode_accelerator_win.h" 61 #include "content/common/gpu/media/dxva_video_decode_accelerator_win.h"
61 #elif defined(OS_CHROMEOS) 62 #elif defined(OS_CHROMEOS)
62 #if defined(USE_V4L2_CODEC) 63 #if defined(USE_V4L2_CODEC)
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 int num_queued_fragments() { return num_queued_fragments_; } 353 int num_queued_fragments() { return num_queued_fragments_; }
353 int num_decoded_frames() { return num_decoded_frames_; } 354 int num_decoded_frames() { return num_decoded_frames_; }
354 double frames_per_second(); 355 double frames_per_second();
355 // Return the median of the decode time of all decoded frames. 356 // Return the median of the decode time of all decoded frames.
356 base::TimeDelta decode_time_median(); 357 base::TimeDelta decode_time_median();
357 bool decoder_deleted() { return !decoder_.get(); } 358 bool decoder_deleted() { return !decoder_.get(); }
358 359
359 private: 360 private:
360 typedef std::map<int32_t, scoped_refptr<TextureRef>> TextureRefMap; 361 typedef std::map<int32_t, scoped_refptr<TextureRef>> TextureRefMap;
361 362
362 scoped_ptr<media::VideoDecodeAccelerator> CreateFakeVDA(); 363 scoped_ptr<media::VideoDecodeAccelerator> CreateFakeVDA();
kcwu 2016/03/01 10:25:06 Unused
Pawel Osciak 2016/03/02 07:17:11 Done.
363 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA(); 364 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA();
364 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2VDA(); 365 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2VDA();
365 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2SliceVDA(); 366 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2SliceVDA();
366 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA(); 367 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA();
367 368
368 void BindImage(uint32_t client_texture_id,
369 uint32_t texture_target,
370 scoped_refptr<gl::GLImage> image);
371
372 void SetState(ClientState new_state); 369 void SetState(ClientState new_state);
373 void FinishInitialization(); 370 void FinishInitialization();
374 void ReturnPicture(int32_t picture_buffer_id); 371 void ReturnPicture(int32_t picture_buffer_id);
375 372
376 // Delete the associated decoder helper. 373 // Delete the associated decoder helper.
377 void DeleteDecoder(); 374 void DeleteDecoder();
378 375
379 // Compute & return the first encoded bytes (including a start frame) to send 376 // Compute & return the first encoded bytes (including a start frame) to send
380 // to the decoder, starting at |start_pos| and returning one fragment. Skips 377 // to the decoder, starting at |start_pos| and returning one fragment. Skips
381 // to the first decodable position. 378 // to the first decodable position.
(...skipping 12 matching lines...) Expand all
394 size_t window_id_; 391 size_t window_id_;
395 RenderingHelper* rendering_helper_; 392 RenderingHelper* rendering_helper_;
396 gfx::Size frame_size_; 393 gfx::Size frame_size_;
397 std::string encoded_data_; 394 std::string encoded_data_;
398 const int num_in_flight_decodes_; 395 const int num_in_flight_decodes_;
399 int outstanding_decodes_; 396 int outstanding_decodes_;
400 size_t encoded_data_next_pos_to_decode_; 397 size_t encoded_data_next_pos_to_decode_;
401 int next_bitstream_buffer_id_; 398 int next_bitstream_buffer_id_;
402 ClientStateNotification<ClientState>* note_; 399 ClientStateNotification<ClientState>* note_;
403 scoped_ptr<VideoDecodeAccelerator> decoder_; 400 scoped_ptr<VideoDecodeAccelerator> decoder_;
404 scoped_ptr<base::WeakPtrFactory<VideoDecodeAccelerator> > 401 base::WeakPtr<VideoDecodeAccelerator> weak_vda_;
405 weak_decoder_factory_; 402 scoped_ptr<base::WeakPtrFactory<VideoDecodeAccelerator>>
403 weak_vda_ptr_factory_;
404 scoped_ptr<GpuVideoDecodeAcceleratorFactory> vda_factory_;
406 int remaining_play_throughs_; 405 int remaining_play_throughs_;
407 int reset_after_frame_num_; 406 int reset_after_frame_num_;
408 int delete_decoder_state_; 407 int delete_decoder_state_;
409 ClientState state_; 408 ClientState state_;
410 int num_skipped_fragments_; 409 int num_skipped_fragments_;
411 int num_queued_fragments_; 410 int num_queued_fragments_;
412 int num_decoded_frames_; 411 int num_decoded_frames_;
413 int num_done_bitstream_buffers_; 412 int num_done_bitstream_buffers_;
414 base::TimeTicks initialize_done_ticks_; 413 base::TimeTicks initialize_done_ticks_;
415 media::VideoCodecProfile profile_; 414 media::VideoCodecProfile profile_;
(...skipping 17 matching lines...) Expand all
433 // textures. 432 // textures.
434 TextureRefMap active_textures_; 433 TextureRefMap active_textures_;
435 434
436 // A map of the textures that are still pending in the renderer. 435 // A map of the textures that are still pending in the renderer.
437 // We check this to ensure all frames are rendered before entering the 436 // We check this to ensure all frames are rendered before entering the
438 // CS_RESET_State. 437 // CS_RESET_State.
439 TextureRefMap pending_textures_; 438 TextureRefMap pending_textures_;
440 439
441 int32_t next_picture_buffer_id_; 440 int32_t next_picture_buffer_id_;
442 441
442 base::WeakPtr<GLRenderingVDAClient> weak_this_;
443 base::WeakPtrFactory<GLRenderingVDAClient> weak_this_factory_;
444
443 DISALLOW_IMPLICIT_CONSTRUCTORS(GLRenderingVDAClient); 445 DISALLOW_IMPLICIT_CONSTRUCTORS(GLRenderingVDAClient);
444 }; 446 };
445 447
448 static bool DoNothingReturnTrue() {
449 return true;
450 }
451
452 static bool DummyBindImage(uint32_t client_texture_id,
453 uint32_t texture_target,
454 const scoped_refptr<gl::GLImage>& image) {
455 return true;
456 }
457
446 GLRenderingVDAClient::GLRenderingVDAClient( 458 GLRenderingVDAClient::GLRenderingVDAClient(
447 size_t window_id, 459 size_t window_id,
448 RenderingHelper* rendering_helper, 460 RenderingHelper* rendering_helper,
449 ClientStateNotification<ClientState>* note, 461 ClientStateNotification<ClientState>* note,
450 const std::string& encoded_data, 462 const std::string& encoded_data,
451 int num_in_flight_decodes, 463 int num_in_flight_decodes,
452 int num_play_throughs, 464 int num_play_throughs,
453 int reset_after_frame_num, 465 int reset_after_frame_num,
454 int delete_decoder_state, 466 int delete_decoder_state,
455 int frame_width, 467 int frame_width,
(...skipping 20 matching lines...) Expand all
476 num_skipped_fragments_(0), 488 num_skipped_fragments_(0),
477 num_queued_fragments_(0), 489 num_queued_fragments_(0),
478 num_decoded_frames_(0), 490 num_decoded_frames_(0),
479 num_done_bitstream_buffers_(0), 491 num_done_bitstream_buffers_(0),
480 fake_decoder_(fake_decoder), 492 fake_decoder_(fake_decoder),
481 texture_target_(0), 493 texture_target_(0),
482 suppress_rendering_(suppress_rendering), 494 suppress_rendering_(suppress_rendering),
483 delay_reuse_after_frame_num_(delay_reuse_after_frame_num), 495 delay_reuse_after_frame_num_(delay_reuse_after_frame_num),
484 decode_calls_per_second_(decode_calls_per_second), 496 decode_calls_per_second_(decode_calls_per_second),
485 render_as_thumbnails_(render_as_thumbnails), 497 render_as_thumbnails_(render_as_thumbnails),
486 next_picture_buffer_id_(1) { 498 next_picture_buffer_id_(1),
499 weak_this_factory_(this) {
487 LOG_ASSERT(num_in_flight_decodes > 0); 500 LOG_ASSERT(num_in_flight_decodes > 0);
488 LOG_ASSERT(num_play_throughs > 0); 501 LOG_ASSERT(num_play_throughs > 0);
489 // |num_in_flight_decodes_| is unsupported if |decode_calls_per_second_| > 0. 502 // |num_in_flight_decodes_| is unsupported if |decode_calls_per_second_| > 0.
490 if (decode_calls_per_second_ > 0) 503 if (decode_calls_per_second_ > 0)
491 LOG_ASSERT(1 == num_in_flight_decodes_); 504 LOG_ASSERT(1 == num_in_flight_decodes_);
492 505
493 // Default to H264 baseline if no profile provided. 506 // Default to H264 baseline if no profile provided.
494 profile_ = (profile != media::VIDEO_CODEC_PROFILE_UNKNOWN 507 profile_ = (profile != media::VIDEO_CODEC_PROFILE_UNKNOWN
495 ? profile 508 ? profile
496 : media::H264PROFILE_BASELINE); 509 : media::H264PROFILE_BASELINE);
510
511 weak_this_ = weak_this_factory_.GetWeakPtr();
497 } 512 }
498 513
499 GLRenderingVDAClient::~GLRenderingVDAClient() { 514 GLRenderingVDAClient::~GLRenderingVDAClient() {
500 DeleteDecoder(); // Clean up in case of expected error. 515 DeleteDecoder(); // Clean up in case of expected error.
501 LOG_ASSERT(decoder_deleted()); 516 LOG_ASSERT(decoder_deleted());
502 SetState(CS_DESTROYED); 517 SetState(CS_DESTROYED);
503 } 518 }
504 519
505 static bool DoNothingReturnTrue() { return true; }
506
507 scoped_ptr<media::VideoDecodeAccelerator>
508 GLRenderingVDAClient::CreateFakeVDA() {
509 scoped_ptr<media::VideoDecodeAccelerator> decoder;
510 if (fake_decoder_) {
511 decoder.reset(new FakeVideoDecodeAccelerator(
512 static_cast<gfx::GLContext*> (rendering_helper_->GetGLContextHandle()),
513 frame_size_,
514 base::Bind(&DoNothingReturnTrue)));
515 }
516 return decoder;
517 }
518
519 scoped_ptr<media::VideoDecodeAccelerator>
520 GLRenderingVDAClient::CreateDXVAVDA() {
521 scoped_ptr<media::VideoDecodeAccelerator> decoder;
522 #if defined(OS_WIN)
523 if (base::win::GetVersion() >= base::win::VERSION_WIN7)
524 decoder.reset(
525 new DXVAVideoDecodeAccelerator(
526 base::Bind(&DoNothingReturnTrue),
527 rendering_helper_->GetGLContext().get()));
528 #endif
529 return decoder;
530 }
531
532 scoped_ptr<media::VideoDecodeAccelerator>
533 GLRenderingVDAClient::CreateV4L2VDA() {
534 scoped_ptr<media::VideoDecodeAccelerator> decoder;
535 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
536 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
537 if (device.get()) {
538 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr();
539 decoder.reset(new V4L2VideoDecodeAccelerator(
540 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
541 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()),
542 weak_client, base::Bind(&DoNothingReturnTrue), device,
543 base::ThreadTaskRunnerHandle::Get()));
544 }
545 #endif
546 return decoder;
547 }
548
549 scoped_ptr<media::VideoDecodeAccelerator>
550 GLRenderingVDAClient::CreateV4L2SliceVDA() {
551 scoped_ptr<media::VideoDecodeAccelerator> decoder;
552 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
553 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
554 if (device.get()) {
555 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr();
556 decoder.reset(new V4L2SliceVideoDecodeAccelerator(
557 device, static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
558 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()),
559 weak_client, base::Bind(&DoNothingReturnTrue),
560 base::ThreadTaskRunnerHandle::Get()));
561 }
562 #endif
563 return decoder;
564 }
565
566 scoped_ptr<media::VideoDecodeAccelerator>
567 GLRenderingVDAClient::CreateVaapiVDA() {
568 scoped_ptr<media::VideoDecodeAccelerator> decoder;
569 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
570 decoder.reset(new VaapiVideoDecodeAccelerator(
571 base::Bind(&DoNothingReturnTrue),
572 base::Bind(&GLRenderingVDAClient::BindImage, base::Unretained(this))));
573 #endif
574 return decoder;
575 }
576
577 void GLRenderingVDAClient::BindImage(uint32_t client_texture_id,
578 uint32_t texture_target,
579 scoped_refptr<gl::GLImage> image) {}
580
581 void GLRenderingVDAClient::CreateAndStartDecoder() { 520 void GLRenderingVDAClient::CreateAndStartDecoder() {
582 LOG_ASSERT(decoder_deleted()); 521 LOG_ASSERT(decoder_deleted());
583 LOG_ASSERT(!decoder_.get()); 522 LOG_ASSERT(!decoder_.get());
584 523
585 VideoDecodeAccelerator::Client* client = this; 524 if (fake_decoder_) {
525 decoder_.reset(new FakeVideoDecodeAccelerator(
526 frame_size_, base::Bind(&DoNothingReturnTrue)));
527 } else {
528 if (!vda_factory_) {
529 vda_factory_ = GpuVideoDecodeAcceleratorFactory::Create(
530 base::Bind(&RenderingHelper::GetGLContext,
531 base::Unretained(rendering_helper_)),
532 base::Bind(&DoNothingReturnTrue), base::Bind(&DummyBindImage));
533 LOG_ASSERT(vda_factory_);
534 }
586 535
587 scoped_ptr<media::VideoDecodeAccelerator> decoders[] = { 536 VideoDecodeAccelerator::Config config(profile_);
588 CreateFakeVDA(), 537 decoder_ = vda_factory_->CreateVDA(this, config);
589 CreateDXVAVDA(), 538 }
590 CreateV4L2VDA(),
591 CreateV4L2SliceVDA(),
592 CreateVaapiVDA(),
593 };
594 539
595 for (size_t i = 0; i < arraysize(decoders); ++i) { 540 LOG_ASSERT(decoder_) << "Failed creating a VDA";
596 if (!decoders[i]) 541
597 continue; 542 decoder_->TryInitializeDecodeOnSeparateThread(
598 decoder_ = std::move(decoders[i]); 543 weak_this_, base::ThreadTaskRunnerHandle::Get());
599 weak_decoder_factory_.reset( 544
600 new base::WeakPtrFactory<VideoDecodeAccelerator>(decoder_.get())); 545 SetState(CS_DECODER_SET);
601 if (decoder_->Initialize(profile_, client)) { 546 FinishInitialization();
602 SetState(CS_DECODER_SET);
603 FinishInitialization();
604 return;
605 }
606 }
607 // Decoders are all initialize failed.
608 LOG(ERROR) << "VideoDecodeAccelerator::Initialize() failed";
609 LOG_ASSERT(false);
610 } 547 }
611 548
612 void GLRenderingVDAClient::ProvidePictureBuffers( 549 void GLRenderingVDAClient::ProvidePictureBuffers(
613 uint32_t requested_num_of_buffers, 550 uint32_t requested_num_of_buffers,
614 const gfx::Size& dimensions, 551 const gfx::Size& dimensions,
615 uint32_t texture_target) { 552 uint32_t texture_target) {
616 if (decoder_deleted()) 553 if (decoder_deleted())
617 return; 554 return;
618 std::vector<media::PictureBuffer> buffers; 555 std::vector<media::PictureBuffer> buffers;
619 556
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 LOG_ASSERT(1U == pending_textures_.erase(picture_buffer_id)); 640 LOG_ASSERT(1U == pending_textures_.erase(picture_buffer_id));
704 641
705 if (pending_textures_.empty() && state_ == CS_RESETTING) { 642 if (pending_textures_.empty() && state_ == CS_RESETTING) {
706 SetState(CS_RESET); 643 SetState(CS_RESET);
707 DeleteDecoder(); 644 DeleteDecoder();
708 return; 645 return;
709 } 646 }
710 647
711 if (num_decoded_frames_ > delay_reuse_after_frame_num_) { 648 if (num_decoded_frames_ > delay_reuse_after_frame_num_) {
712 base::MessageLoop::current()->PostDelayedTask( 649 base::MessageLoop::current()->PostDelayedTask(
713 FROM_HERE, 650 FROM_HERE, base::Bind(&VideoDecodeAccelerator::ReusePictureBuffer,
714 base::Bind(&VideoDecodeAccelerator::ReusePictureBuffer, 651 weak_vda_, picture_buffer_id),
715 weak_decoder_factory_->GetWeakPtr(),
716 picture_buffer_id),
717 kReuseDelay); 652 kReuseDelay);
718 } else { 653 } else {
719 decoder_->ReusePictureBuffer(picture_buffer_id); 654 decoder_->ReusePictureBuffer(picture_buffer_id);
720 } 655 }
721 } 656 }
722 657
723 void GLRenderingVDAClient::NotifyEndOfBitstreamBuffer( 658 void GLRenderingVDAClient::NotifyEndOfBitstreamBuffer(
724 int32_t bitstream_buffer_id) { 659 int32_t bitstream_buffer_id) {
725 // TODO(fischman): this test currently relies on this notification to make 660 // TODO(fischman): this test currently relies on this notification to make
726 // forward progress during a Reset(). But the VDA::Reset() API doesn't 661 // forward progress during a Reset(). But the VDA::Reset() API doesn't
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 } 763 }
829 764
830 for (int i = 0; i < num_in_flight_decodes_; ++i) 765 for (int i = 0; i < num_in_flight_decodes_; ++i)
831 DecodeNextFragment(); 766 DecodeNextFragment();
832 DCHECK_EQ(outstanding_decodes_, num_in_flight_decodes_); 767 DCHECK_EQ(outstanding_decodes_, num_in_flight_decodes_);
833 } 768 }
834 769
835 void GLRenderingVDAClient::DeleteDecoder() { 770 void GLRenderingVDAClient::DeleteDecoder() {
836 if (decoder_deleted()) 771 if (decoder_deleted())
837 return; 772 return;
838 weak_decoder_factory_.reset(); 773 weak_vda_ptr_factory_.reset();
839 decoder_.reset(); 774 decoder_.reset();
840 STLClearObject(&encoded_data_); 775 STLClearObject(&encoded_data_);
841 active_textures_.clear(); 776 active_textures_.clear();
842 777
843 // Cascade through the rest of the states to simplify test code below. 778 // Cascade through the rest of the states to simplify test code below.
844 for (int i = state_ + 1; i < CS_MAX; ++i) 779 for (int i = state_ + 1; i < CS_MAX; ++i)
845 SetState(static_cast<ClientState>(i)); 780 SetState(static_cast<ClientState>(i));
846 } 781 }
847 782
848 std::string GLRenderingVDAClient::GetBytesForFirstFragment( 783 std::string GLRenderingVDAClient::GetBytesForFirstFragment(
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 content::VaapiWrapper::PreSandboxInitialization(); 1578 content::VaapiWrapper::PreSandboxInitialization();
1644 #endif 1579 #endif
1645 1580
1646 content::g_env = 1581 content::g_env =
1647 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( 1582 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>(
1648 testing::AddGlobalTestEnvironment( 1583 testing::AddGlobalTestEnvironment(
1649 new content::VideoDecodeAcceleratorTestEnvironment())); 1584 new content::VideoDecodeAcceleratorTestEnvironment()));
1650 1585
1651 return RUN_ALL_TESTS(); 1586 return RUN_ALL_TESTS();
1652 } 1587 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698